Grazing Goats

For each candidate bucket point, fix each rope at its pole distance and compute the area shared by all disks.

Hard8GeometryNo attempts yetTime limit5sMemory limit512 MB

Problem

Farmer John brought NN goats to his field. Goat ii is tied to a pole at position PiP_i with a rope of length LiL_i. The goat can go anywhere within distance LiL_i of the point PiP_i, and nowhere outside that. The field is large and flat, so treat it as an infinite two-dimensional plane.

The pole positions stay where Farmer John put them for his last herd, so only the rope lengths are still open. Two conditions make that choice tricky.

  • Every goat has to reach one water bucket. Farmer John has not decided where the bucket goes. He narrowed the candidates down to Q1,Q2,,QMQ_1, Q_2, \dots, Q_M, but he does not know which one he will use.
  • The goats are ill-tempered, and they get into noisy fights when they gather. For everyone's peace of mind, Farmer John wants the area AA that every goat can reach to be as small as possible.

Farmer John is not good at geometry, so he needs help with this part.

For each bucket position QjQ_j, pick the rope lengths so that the area AjA_j reachable by every goat is as small as possible when the bucket sits at QjQ_j, then compute that area AjA_j.

Figure

In the picture below, the four blue points are the pole positions P1,P2,P3,P4P_1, P_2, P_3, P_4, and the two red points are the candidate bucket positions Q1Q_1 and Q2Q_2. The two shaded regions have areas A1A_1 and A2A_2.

Four poles, two candidate bucket positions, and the two minimal regions

Input

The first line contains the number of test cases TT. The TT test cases follow. Each test case begins with a line containing the integers NN and MM.

The next NN lines contain the pole positions P1,P2,,PNP_1, P_2, \dots, P_N, one per line, and the MM lines after that contain the candidate bucket positions Q1,Q2,,QMQ_1, Q_2, \dots, Q_M, one per line.

Each of these N+MN + M lines holds the xx coordinate and the yy coordinate of the corresponding position, separated by a single space.

Limits

  • Every coordinate is an integer between 1000-1\,000 and 10001\,000.
  • Within one test case, P1,,PN,Q1,,QMP_1, \dots, P_N, Q_1, \dots, Q_M are all distinct, and no three of them are collinear.
  • 1T51 \le T \le 5
  • 2N10002 \le N \le 1\,000
  • 1M1001 \le M \le 100

Output

For each test case, print one line in the format Case #x: A1 A2 ... AM, where x is the test case number starting from 1, and A1A_1 through AMA_M are separated by single spaces.

Print each area rounded to exactly three digits after the decimal point. When the minimum area is 0, print 0.000.