All submissions for this problem are available.
On board the hovercraft Nebuchadnezzar, Neo is practicing his skills for the Matrix. Tank loads Neo
into the Jump program, where he must jump from the the top of one building to the next. In the
Matrix, by concentrating hard Neo can a ect gravity to slow the change in the rate of his fall to 5
meters/second. As long as Neo does not land, he will continue to move forward at the same speed he
was running before his jump.
Tank can approximate Neo's jump by calculating his speed and position every second. For example,
if Neo jumps up with a speed of 10 meters/second while running at 30 meters/second, the results are:
|0 seconds||0 meters||0 meters||up 10 meters/sec|
|1 seconds||30 meters||10 meters||up 5 meters/sec|
|2 seconds||60 meters||15 meters||up 0 meters/sec|
|3 seconds||90 meters||15 meters||down 5 meters/sec|
|4 seconds||120 meters||10 meters||down 10 meters/sec|
|5 seconds||150 meters||0 meters||down 15 meters/sec|
As a result, Neo will jump 150 meters and stay in the air for 5 seconds.
Tank starts testing Neo with jumps to buildings that are at di erent distances away. For simplicity,
Tank will calculate Neo's position at the end of every second, even though more accurate calculations
are possible by if shorter intervals are used.
First line of input consists of the number of test cases t<=1000.
For each test case t, the 2nd line of input consists of a list of three numbers representing a jump to a target building:
1. the speed Neo is running (in meters/second) <=500,
2. the speed Neo jumps up into the air (in meters/second) <=500,
3. the distance to the target building (in meters) <=500.
For each test case
Print the distance and height of Neo's jump after each second as a pair of numbers on a new line, starting
at one second. Repeat each second until Neo lands (height reaches zero or below). Use integers for
calculating results. For each building, output "yes" if Neo is within 3 meters of the building when he
lands (height <= zero), else print "no".
Input: 2 30 10 150 10 12 65 Output: 30 10 60 15 90 15 120 10 150 0 yes 10 12 20 19 30 21 40 18 50 10 60 -3 no
|Time Limit:||1.25 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.