提示: 欢迎访问OurACM平台。
Problem 1984 Cover Game

Accept: 98    Submit: 255
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

In the country of giantarum, there is a park. They are two big trees there, “T1” and “T2”. To simplify the problem, we consider the park as an infinite plane, and the two trees “T1” and “T2” as two non-intersect circle. Now a giantarum called AC want to enclose a rectangle region that containing the two trees and make sure that the area of the region is minimum. The following figure shows one best way.

Input

In the first line there is an integer T, indicates the number of test cases. (T <= 10)

In each case, the first line contains three floating numbers x0, y0, r0, indicating the coordinate and the radius of “T1” ; Then one line contains three floating numbers x1, y1, r1, indicating the coordinate and the radius of “T2” ; You may assume that “T1” and “T2” are non-intersect.

Output

For every test case, output one line.First output “Case idx: ”, here idx is the case number start from 1.Then output the minimum area of the region ,rounded to 3 digits after the decimal point.

Sample Input

2 0 0 1.0 2.0 0.0 1.0000000000 0 0 1.0 0.0 2.0 1.00

Sample Output

Case 1: 8.000 Case 2: 8.000

Source

FOJ有奖月赛-2010年11月

Submit  Back  Status  Discuss