Problem S
Sneak Attack
You are in a game of laser tag, where the goal is to shoot and hit other players with the laser gun you are carrying. Running up to them and shooting sometimes works, but it leaves you more vulnerable to their counterattack than you would like. You have found that you can be sneakier if you bounce your shot off of a mirror before it hits them. This allows you to shoot around a corner, for example.
To practice your shots, you shoot at a wall (the target) by
reflecting your shot off of a mirror. Write a program that
tells you where on the target wall your laser would strike when
shooting from different locations. The wall is considered to be
infinitely long at
![\includegraphics[width=0.3\textwidth ]{shooting}](/problems/sneakattack/file/statement/en/img-0001.png)
Input
Input consists of up to
Output
For each test case, report the
Sample Input 1 | Sample Output 1 |
---|---|
5 10 10 10 10 0 5 10 10 5 10 0 6 10 10 10 10 0 |
negative-infinity 0 5 12.5 negative-infinity -5 |
Sample Input 2 | Sample Output 2 |
---|---|
10 10 20 20 20 10 |
can't hit the wall |