All submissions for this problem are available.
Pilot styrofox was sent on a mission to enemy territory. He is flying in a bomber plane. Captain Dinesh: Hello styrofox! You got a new task. Pilot Styrofox : Yeah! Am waiting for that.. Captain Dinesh: Few enemy tankers has arrived. You need to take them before they attack your squadron. Pilot Styrofox : Oh! this must be a simple one. Captain Dinesh: Not as you think you've got only limited bombs. More tankers are expected to arrive so use just one. Pilot Styrofox : Give me a second. I'll finish it off.. Captain Dinesh: Just wait. Since it is possible for you to be locked by enemies, just make your shot from xd,yd,zd which is closest safe point. Pilot Styrofox : Anything more ? Captain Dinesh: That's it for now. Give your best shot. Go! Go! Go! Pilot Styrofox : Copied that!!
The bomb being dropped kills any life around 50km where it explodes.
The damage it makes on the tanker is inversely proportional to the
square of distance between tanker and the point of explosion.
Now your task is to compute the speed with which the bomb must be dropped
at the point xd,yd,zd such that no tanker remains better than rest in the group and to damage severely. As the pilot doesn't
want to take risk he flies the plane towards the direction of his interest
for this task through the point xd,yd,zd without lowering the altitude.
First line contains T, No.of test case. For each test case, the first line contains
three integers xd,yd and zd separated by a single space.Second line contains an integer N,
which is the number of tankers.Following N line contains two integer xi,yi separated by a
single space denoting the position of ith tanker in the ground. Test cases are separated by
a new line.
All coordinate given are scaled in kilometers from the reference point 0,0,0. T<=10 1<=N<=10 0<=xi,yi,zi<=1000 acceleration due to gravity 9.8 m/s2
For each test print the speed to be attained by the pilot in km/hr correct upto 3 decimal
place separated by a new line.Incase if it is not possible to take all the tankers just
print "NEGATIVE" instead.
Input: 2 8 9 10 2 0 0 0 110 8 9 10 3 0 0 0 3 1 1 Output: NEGATIVE 873.862461
Since the blast radius is limited to 50km, it cannot take both tankers at a time.
The bomb will be dropped at 0,1.5 to damage the tankers at 0,0 and 0,3 equally. The one at 1,1 is still closer to point of explosion and hence no tanker remains better than the rest in the group.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.