eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Pavement Signage

Pavement Signage

Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB

Words and symbols painted on roads must be elongated because drivers view roads at an angle. For example, using the figure below, a safety engineer uses an assumed eye level above the road of h, and designates how big the symbol should appear at a distance d from the driver’s position. The apparent size is expressed as the angular size of the driver’s field of view, α. The road (the horizontal line in the figure) is assumed to be perfectly flat.

The sign’s appearance to the driver is intended to be as if it was positioned in the plane labeled P in the figure, exactly filling the field of view. The plane is perpendicular to the dashed line from the driver's eye to the point at distance d along the road from the driver's position. Of course, a point in a sign that is "virtually" in this plane is actually on the pavement at the point where a line from the driver's eye through the point in the plane would intersect the road. Thus the sign on the pavement will fill the area labeled "sign" in the figure. In other words, scale the maximum y value to be 100% of P, and smaller y values to appropriate percentages of P, and display the corresponding length of the distance labeled "sign" in the figure.

Write a program that will provide information to be used in preparing a stencil for painting signs on roadways, given h, d, α, and a description of the "un-stretched" symbol. The symbol description is given as a sequence of points in a Cartesian coordinate system so that the "un-stretched" symbol could be drawn by "connecting the dots" – draw a line from the first point to the second point, then to the third point, and so forth, and finally draw a line back to the first point. For example, an arrow indicating the driver should travel straight in the lane with the symbol might look like the figure shown to the left, which is specified by giving the coordinates of the seven points labeled P0 through P6. The dashed lines represent the X and Y axes, and the dotted lines represent the outline of the figure. The technician who measures the un-stretched symbol aligns it so that the leftmost point(s) touch the Y axis, and the bottommost point(s) touch the X axis.

The horizontal perspective of the symbol is not adjusted; only the y values for the points in the symbol are modified.

Вхідні дані

There will be an arbitrary number of cases to consider. The input for each case begins with a single line containing three real numbers h, d, and α, and an integer n separated from each other by whitespace. h and d are given in meters, and α is given in degrees. This line is followed by n lines, each containing two real numbers x and yrepresenting the Cartesian coordinates of a point in the symbol to be drawn. n will never be larger than 20.

Input for the last case is followed by a line containing four zeros.

Вихідні дані

For each input case, first display a line containing the case number (1, 2, …). After this, display one line giving the x and y coordinates for each point in the stretched symbol. Display two digits after the decimal point in each x and y value. Indent each of these lines by three (3) spaces, put one space between the x and y values, and no trailing whitespace after the y value. Display a blank line after the output for each case. Follow the format of the sample output.

Приклад

Вхідні дані #1
1.5 8 6.0 7
0.7   0.6
0.35 1
0     0.6
0.2   .6
0.2  0
0.5  0
0.5 .6
0 0 0 0
Вихідні дані #1
Case 1:
   0.70 4.20
   0.35 10.56
   0.00 4.20
   0.20 4.20
   0.20 0.00
   0.50 0.00
   0.50 4.20

Джерело ACM North Central North America Regional Programming Contest, November 12, 2011