## DWITE '08 R4 #1 - Four player Pong with no players

View as PDF

Points: 7
Time limit: 1.0s
Memory limit: 64M

Problem type
##### DWITE Online Computer Programming Contest, January 2008, Problem 1

This "game" has been simplified so much that all the players left. Incidentally, with no paddles left on the screen, it makes it even more simple, as there is nothing to bounce off. The only objective left now is to figure out where the ball will hit the edge of the playfield.

The playfield is a rectangle of the size 100 wide by 50 high. Lower left corner is at ; upper right is at . The ball is the size of a single pixel, and the score counts as that pixel lands on the edge. The ball starts at the center, at , and its velocity will be provided in the input.

The input will contain 5 sets of input, 2 lines each. The first line will be an integer value , the horizontal component of the velocity. The second line will be an integer value , the vertical component of the velocity. There will be no input, and thus there will always be a solution.

The output will contain 5 lines, the location where the ball hits the edge, in the format.

Note: if one was to simulate the game using a loop, the integer values in all of the cases will land exactly on an edge during one of the steps.

Another note: Some might want to draw to screen while developing or debugging their code – this could be helpful to get a better idea of what's going on, but please remember to comment out any graphical code before submitting a solution.

#### Sample Input

5
0
0
-5
5
5

#### Sample Output

100,25
50,0
75,50

Problem Resource: DWITE

• commented on Feb. 20, 2019, 4:03 p.m.

Why does the Sample input and output not match the explanation of the in and output at the top part of the document? Or am i missing something.

Ex:

output will contain 5 lines, the location where the ball hits the edge, in the x,y format.

and then the sample output only has 3 lines

100,25
50,0
75,50

Same problem with the sample input.

• commented on Feb. 20, 2019, 7:49 p.m.

The samples only have 3 cases; the actual test case has 5.