BLMIRINA - Archery Training
Mirana is an archer with superpower. Every arrow she shoots will get stronger the further it travels. Mirana is currently on the way to warzone.
Since the road is still a long way, Mirana remembers about when she's still in training. In each of her training, Mirana stands on the (0,0) point in a cartesian scale. From that point, she must shoot a circle centered in (x,y) with radius r. Everything happens in z=0.
To maximize the arrow's power, Mirana must shoot the furthest point of the enemy possible. Her arrow travels at the speed of light and will instantly stops the moment it touches the target. On the target, determine the coordinate point that Mirana has to shoot to get maximum power. If multiple coordinate exists, choose the one with the lower x value.
First line is T, number of training (T < 100000). Next T lines each contains 3 space separeted integers x, y, and r for each training (1 < r < x,y < 1000)
For each training, output a line containing the coordinate of the arrow's destination separated by space. Output until 6 digit after decimal point.
1 1 1
2 2 1
4 5 2
Output: 0.000000 1.000000
for a test case say 1 179 56 56 , i get answer 147.084593 102.015289 , while the judge apparently accepts 147.084601 102.015294 , which is just slightly different. how do i go about this... here's my code <deleted>
@Andy please check my submission http://www.spoj.com/submit/BLMIRINA/id=19526011 Getting WA
Last edit: 2016-10-07 09:11:03
@bajaj_18, the arrow stops instantly when it touches the target. Therefore it cannot reach 1.707 1.707. The furthest points are 0 1 and 1 0. The one with the smallest x-value is 0 1.
can anyone explain the test cases...for 1 1 1,the answer should be 1.707 1.707 as then the distance travelled is 2.414 which is more than 1 which is from 0 1.(she stands at the origin and not the centre of the circle)
@Andy can you plz check my submission i don't get why i am getting wa