Each of the two disks centered at the poles must cover the bucket point, and the answer is the overlap area of the smallest such disks.
Easy3GeometryMathNo attempts yetTime limit5sMemory limit512 MBFarmer John has brought in N goats. Goat i is tied to a pole at position Pi with a rope of length Li, so goat i can go anywhere within distance Li of the point Pi and nowhere else. The field is large and flat, so treat it as an infinite plane.
The pole positions are already fixed, and Farmer John only has to pick the rope lengths. Two things make that choice awkward.
For each bucket position Qj, pick rope lengths that minimize the area Aj reachable by every goat, then compute that Aj.
The picture below shows a field with four poles. The four blue points are the pole positions P1,P2,P3,P4 and the two red points are the candidate bucket positions Q1 and Q2. The two shaded regions have areas A1 and A2. In this problem there are always two poles.

The first line contains the number of test cases T. The first line of each test case contains the integers N and M.
The next N lines contain the pole positions P1,P2,…,PN, one per line, followed by M lines containing the bucket positions Q1,Q2,…,QM, one per line. Each of these N+M lines contains the x and y coordinate of that point, separated by a single space.
For each test case, print one line in the form Case #x: A1 A2 ... AM, where x is the test case number starting from 1 and Aj is the area defined above.
Round every area and always print four digits after the decimal point, separating the values with a single space. For example, print 0.2939 for an area of 0.2939440 and 10.7080 for an area of 10.708.