Given launch speed and target distance, compute the smallest launch angle in degrees that lands exactly on the target.
Easy3MathNo attempts yetTime limit5sMemory limit512 MBThe Hamjet is a product of aircraft engineering. It has a single engine, and that engine is so powerful that it burns all of the fuel the instant the plane takes off. The Hamjet has no wings, because its fuselage is made of a special Wonderflonium isotope that keeps it from taking any damage.
Flying the Hamjet is not a job for a superhero with an ordinary body. That is why the Hamjet belongs to Captain Hammer, who also takes no damage. The G forces a pilot endures on a Hamjet trip are legendary.
The Hamjet takes off at an angle of θ degrees above the horizontal at a speed of V meters per second. V is a fixed value set by the power of the engine and the capacity of the fuel tank. The destination is D meters away. Given V and D, write a program that computes θ.
The Wonderflonium fuselage is not affected by air friction. The Hamjet never flies very far or climbs very high, so assume the ground is flat and the acceleration due to gravity is a constant 9.8 m/s² downward.
The first line contains the number of test cases T. Each of the next T lines contains two integers V and D.
For each test case, print one line in the form Case #x: θ, where x is the test case number starting from 1 and θ is the launch angle measured in degrees above the horizontal.
If several angles satisfy the conditions, print the smallest positive one. Round θ at the eighth decimal place and always print all seven decimal digits.