SQDIFF - Area Difference

A gardener bought two sprinklers for his new garden. Each sprinkler moistens the soil around a circle with known radius. One will be working in the morning and the other in the evening. To plan how many plants of different species is better to plant, the gardener wants to know what area of the garden will be watered only in the morning, only in the evening or both in the morning and in the evening. After some searching on the Internet, he found a formula for calculating the area of intersection of circles, but for some reason the formula that would help to calculate the remaining two areas was not found.

Input

The first line contains T (1 <= T <= 1000) - the number of tests. The next T lines contain six integers x1, y1, r1, x2, y2 and r2 (0 <= xi, yi, ri <= 10000) - coordinates and radii of the first and second sprinkler, respectively.

Output

For each test case print the absolute value of the difference between the the area that is going to be watered only in the moring and the area that is going to be watered only in the evening rounded to two decimals after the point. Your score is the source length.

Example

Input:
1
2 2 4 5 2 3

Output:
21.99


Added by:Spooky
Date:2010-03-09
Time limit:3s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Advancement Spring 2010, http://sevolymp.uuuq.com/, author: Alexey Shchepin

hide comments
2015-01-20 07:19:46 XeRoN!X
@Author, kindly rejudge all Perl solutions submitted before compiler upgradation to 5.12.1
2015-01-20 07:19:46 vengadesh.v
what are mean by...x,y
2015-01-20 07:19:46 .::Manish Kumar::.
ya...i got ac with 1.50

Last edit: 2010-06-27 14:23:15
2015-01-20 07:19:46 .::Manish Kumar::.
it appears
option a:1.50
is correct

Last edit: 2010-06-27 13:55:39
2015-01-20 07:19:46 .::Manish Kumar::.
how should i round 1.5?
option a:1.50
option b:1.5
2015-01-20 07:19:46 numerix
rounding: as usual
pi: 3.141592653589793238462643383279
output: read the description above
2015-01-20 07:19:46 Tarun Chauhan
what are the rules of rounding? and whats the value of pi? and whats the output format?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.