Pulse Nova

아직 제출이 없습니다시간 제한20초메모리 제한256 MB

문제

Mr.Panda is playing a game named Watcher of Samsara, a famous tower defense game developed by a Chinese studio. At the beginning of the game, every player is able to choose their first hero arbitrarily from the hero pool which is randomly generated by the game system. Among all the heroes, Mr.Panda always chooses the hero named Leshrac, because of the character's ultimate skill, Pulse Nova.

Pulse Nova creates waves of damaging energy around Leshrac, one per second, to damage all nearby enemy units. This powerful skill inspires Mr.Panda to come up with a geometry problem.

There are nn straight lines on the 2D plane, where the ithi^{th} line passes two integer points P_iP\_i and Q_iQ\_i. You need to place a circle with radius of exactly RR on the plane. For each given line, there might be a segment part of this line that will be inside the circle. Please find a position for this circle to maximize the total length of all segment parts which will be inside the circle.

입력

The first line of the input gives the number of test cases, TT (1T100)(1 \le T \le 100). TT test cases follow.

The first line of each test case contains two integers nn (1n50)(1 \le n \le 50) and RR (1R3000)(1 \le R \le 3000), the number of straight lines, and the radius of the circle, respectively.

In the next nn lines, each contains four integers. In the ithi^{th} line, the first two integers indicate the 2D coordinates of point P_iP\_i, and the last two integers indicate the 2D coordinate of point Q_iQ\_i. We ensure that P_iQ_iP\_i \ne Q\_i and the absolute value of every coordinate is not greater than 10001000.

We ensure the sum of nn in all test cases is not greater than 100100.

출력

For each test case, output one line containing "Case #x: y", where x is the test case number (starting from 1) and y is the maximum length which will be inside the circle. Your answer will be considered correct if it is within an absolute or relative error of 10610^{-6} when compared with the correct answer.

힌트

For the first sample, you can place the center of the circle at (1,1)(1, 1), so the total length inside the circle will be 88.

For the second sample, you can place the center of the circle at (0,1)(0, 1), so the total length inside the circle will be 12+8212 + 8\sqrt{2}.