Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Hasinur Has Two

By moshiur_cse15 · Limits 1s, 512 MB

You all have heard the name of great landlord Hasinur the !Generalman. He has a huge land. The land has a shape of a right triangle with base b and height h. Hasinur the !Generalman wants his land to be divided between his two wives. The distribution process is to cut the triangle from the intersecting point of base and height to the hypotenuse of the triangle with an angle of 𝛳 with the base. You can illustrate the distribution process in the following figure.

Now his younger wife has hired you to check how much land_(area of land)_ she and other wife will receive if the distribution process is performed by Hasinur the !Generalman. The lower part of the distribution line will be received by the younger wife and the other part by the elder wife.

Input

First line will have an integer T, testcase no. Then the following T line have three integers each b, h and 𝛳 as described above.
T ≤ 1000
1 ≤ b, h ≤ 1000
0 < 𝛳 < 90

Output

Print "Case x: " (without quotes) where x is the case no, and then two space-separated floating point number, exactly three digits after the decimal point, first one is the land that will be received by the younger wife and then by the elder one. Look at samples for better illustration.

Sample

InputOutput
1
4 4 45
Case 1: 4.000 4.000

In case you need to use PI, value of PI = acos(-1.00), basically cos-1. So, in C or C++, writing the code double PI = acos(-1.00); would work.

Discussion

Statistics


41% Solution Ratio

itachi201103Earliest, Nov '18

Circle.21Fastest, 0.0s

itachi201103Lightest, 131 kB

mashfiqur404Shortest, 299B

Submit

Login to submit

Related Contests

Toph uses cookies. By continuing you agree to our Cookie Policy.