401579: GYM100495 K Wolf and sheep

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. Wolf and sheeptime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

A sheep lives on an infinite field. The sheep wants to eat some grass. Grass only exists in one place. That place is a circle defined by a center point (Gx, Gy) and a radius Gr.

The sheep would gladly eat all the grass. But if you read the title of this task you noticed that there is also a wolf on that field. The wolf wants to eat the sheep, but we don't want that to happen.

The wolf is tied to a pole at position (Wx, Wy) with a rope of length Wr.

Find the area of grass that the sheep can eat without being eaten by the wolf. We can assume that the sheep starts in a safe location.

Input

The first line contains the number of test cases T (1 ≤ T ≤ 10000).

Each test case consists of 2 lines. The first line contains integers Gx, Gy and Gr. The second line contains integers Wx, Wy and Wr. ( - 105 ≤ Gx, Gy, Wx, Wy ≤ 105, 1 ≤ Gr, Wr ≤ 105)

Output

For each test case output one line containing “Case #tc: A”, where tc is the number of the test case (starting from 1) and A is the area of grass that the sheep can eat safely with a maximum absolute or relative error of 10 - 6.

ExamplesInput
2
0 0 5
0 10 5
0 0 5
5 0 5
Output
Case #1: 78.53981634
Case #2: 47.83057387

加入题单

算法标签: