Shoot the Target
Time limit5sMemory limit512 MB
Pick the ground point on the x-axis that makes the given segment look widest and output that largest angle in degrees.
Problem
Kazuki plays an artillery game. A target hangs in the air above flat ground, and the target is slanted, so it is not perpendicular to the ground. Kazuki may shoot from any point on the ground, and he wants to stand where the target looks widest. Find the largest visible angle of the target in degrees.
The world is the 2D plane with the y-axis pointing up toward the sky. The ground is the x-axis. The target is the line segment joining the two endpoints and .
The visible angle from a ground point is the angle at the vertex formed by , and . The that maximizes the angle is not necessarily an integer.
Input
The first line has the number of test cases . Each of the next lines has four integers , , , separated by spaces, the coordinates of the two ends of the target.
Limits
Output
For each test case, print one line of the form Case #t: Z, where t is the case number starting from 1 and Z is the largest visible angle of the target in degrees. Print Z rounded to exactly four digits after the decimal point, always with all four digits. An answer of exactly 90 degrees prints as 90.0000.