Pick the ground point on the x-axis that makes the given segment look widest and output that largest angle in degrees.
Medium6GeometryMathNo attempts yetTime limit5sMemory limit512 MBKazuki 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 (X1,Y1) and (X2,Y2).
The visible angle from a ground point (X,0) is the angle at the vertex (X,0) formed by (X1,Y1), (X,0) and (X2,Y2). The X that maximizes the angle is not necessarily an integer.
The first line has the number of test cases T. Each of the next T lines has four integers X1, Y1, X2, Y2 separated by spaces, the coordinates of the two ends of the target.
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.