Shoot the Target (Small1)

Given a slanted segment above the x-axis, find the point on the x-axis that sees the segment under the largest angle and print that angle in degrees.

Medium6GeometryMathNo attempts yetTime limit5sMemory limit512 MB

Problem

Kazuki is playing Worms. A target hangs above the ground and he has to hit it. 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 that maximum visible angle in degrees.

The world is a 2D plane with the yy axis pointing up toward the sky. The ground is the xx axis. You are given the coordinates of the two endpoints of the target, (X1,Y1)(X_1, Y_1) and (X2,Y2)(X_2, Y_2). The target is the line segment between those two points.

The visible angle Kazuki wants to maximize is the angle formed by the points (X1,Y1)(X_1, Y_1), (X,0)(X, 0) and (X2,Y2)(X_2, Y_2), with its vertex at (X,0)(X, 0). The optimal XX is not necessarily an integer.

Input

The first line contains the number of test cases TT. Each of the next TT lines contains four integers X1X_1, Y1Y_1, X2X_2 and Y2Y_2 separated by spaces, where (X1,Y1)(X_1, Y_1) and (X2,Y2)(X_2, Y_2) are the coordinates of the two ends of the target.

Limits

  • 1T1001 \le T \le 100
  • X1X2X_1 \ne X_2
  • 1Y1,Y2101 \le Y_1, Y_2 \le 10
  • 10X1,X210-10 \le X_1, X_2 \le 10

Output

For each test case, print one line in the form Case #t: Z, where tt is the test case number starting from 1 and ZZ is the maximum visible angle in degrees that Kazuki can achieve. Round ZZ to six decimal places and always print all six digits, so an angle of exactly 90 degrees prints as 90.000000.