Loading...
Spinning Spinners
Time: 1 s
Memory: 125 MB
Mr. Toto loves spinning different kinds of spinners. He enjoys watching them go round and round, bringing him happiness. While passing beside a shop, suddenly he saw a unique spinner named spinning spinners. The spinner is a fusion of 3 spinners.

First spinner which carries two more spinners in its both ends is X cm long. Interestingly, its wheel is not in the middle, it's located d cm away from the left side. The second spinner is a rectangular shaped spinner which is h cm long and w cm width which is located in the left end of the first spinner. The last spinner which is located on the right side of the first spinner is Equilateral triangular shaped with side a. Both the wheels of second and third spinners are in their centroid.

As it is too amazing to watch some spinners like that, Mr. Toto wonders how much area is covered by the unique spinner  while spinning. As he is not good at mathematics, he wants your help to find out the area.

Note that pi = 3.1416
 
Input
The first line of input contains an integer T, Number of test cases. Each test case contains 3 lines.
First line contains 2 integers x,d . The next line contains 2 integers h,w length and width of the rectangle.And the final line contains one of the triangle a.
Constraint
T(1<=T<=\(10^5\))
x,d (1<=x,d<=\(10^5 \))
h,w(1<=h,w<=\(10^5 \))
a(1<=a<=\(10^5 \))
Output
For each test case, print the case number and the area that is covered by the spinner with 4 digits after the decimal point.
Examples
Input
Output
3
5 2
2 3
3
6 3
2 3
3
6 3
3 3
3
Case 1: 70.3477
Case 2: 72.4662
Case 3: 82.3976
Problem Info
Problem ID 190
Time Limit 1000 ms
Memory Limit 128000 KB
Moderators Alom_Shanto , mfctanzim
Statistics
Submit
You need to Login or Registration for submit your solution