Union of circles#4385

Union of circles

1 second
256 megabytes
Very hard

Find the area of the union of circles.

Input

The first line contains the number of test cases (1 \leq K \leq 10).

The first line of each test case contains the number of circles (1 \leq N \leq 100). The following lines each contain the center's coordinates and the radius of a circle, as x_i y_i r_i. All coordinates are integers not exceeding in absolute value. The radius is a positive integer no greater than .

Output

For each test case, output the area of the union of the circles, with digits after the decimal point.

Examples

Example 1

Loading
Loading