All submissions for this problem are available.
John is a notorious theaf, popular for stealing artifacts. Once, being afraid of getting caught, he went into the forest to hide the stolen artifacts. As the forest was big, it was hard to remember and track the exact location of the hidden artifacts, so at the time of hiding he placed a device along with it, which can continuously send signal. John kept a similar device for himself that was paired with the hidden device and it could only measure the strength of the signal emitted by the device that was hidden. After ensuring his safety, John went to the forest again to retrieve the artifacts. Assuming that forest is spread over a rectangular area, let us say that John enters the forest at point (0,0), which is one of the corner points of forest. Now John moves randomly at different locations and if John moves to a location that is closer to the object than the previous location, the device starts beeping at faster rate and at slower rate if he moves farther away. The rate of beeping remains same if the distance remains same.
1st line contains number of test cases.
1st line of each test case consist of two integers x and y,separated by spaces, where (x,y) is coordinate diagonally opposite to (0,0).
2nd line of test case contains an integer N, which is followed by N lines each containing three values a,b,c separated by spaces where (a,b) = location of John and c=1 if closer than the previous distance, -1 if farther away than the previous distance, 0 if John is at the same distance. (This N lines are in sequence, according to the movement of John)
For each test case, output the area in which the artifact may be present for each of the N lines mentioned above(rounded to 2 decimal points). Output zero if there is no such area.
Input: 1 50 50 4 50.0 50.0 -1 50.0 0.0 1 0.0 0.0 -1 50.0 50.0 1 Output: 1250.00 937.50 312.50 0.00
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, 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, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.