Time Limit: 1000 mSec
Memory Limit: 32768 KB
Rendering realistic images of imaginary environments or objects is an interesting topic in computer graphics. One of the most popular methods for this purpose is ray-tracing.
To render images using ray-tracing, one computes (traces) the path that rays of light entering a scene will take. We ask you to write a program that computes such paths in a restricted environment.
For simplicity, we will consider only two-dimensional scenes. All objects in the scene are totally reflective (mirror) spheres. When a ray of light hits such a sphere, it is reflected such that the angle of the incoming ray and the leaving ray against the tangent are the same:
The following figure shows a typical path that a ray of light may take in such a scene:
Your task is to write a program, that given a scene description and a ray entering the scene, determines which spheres are hit by the ray.
A test case starting with n = 0 terminates the input. This case should not be processed.
Output a blank line after each test case.