(Almost) Fair Cake-Cutting

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

문제

You are surely familiar with the fair cake-cutting scheme, where one person cuts the cake in two and the other person gets to choose which part they would prefer to eat. This solution is supposed to be fair as neither of the participants can claim to have received the smaller part as the result.

Well, at Alice's, it is her who dictates the rules -- and they are most certainly not supposed to be fair. She orders her younger brother, Bob, to make nn cuts rather than one. Now, for every cut, Alice chooses one of the sides and eats all the cake at this side. After she finishes going through all the cuts, Bob gets to eat the rest.

The cake is represented as a square on the Cartesian plane (it is actually a cuboid, of course, but we assume all the cuts to be perpendicular to the surface) with side length MM. Bob has just made nn cuts and now it is time for Alice to make her choices. Determine how much cake will she be able to eat if she chooses wisely.

입력

The first line of input contains the number of test cases zz (1z5001 \leq z \leq 500). The descriptions of the test cases follow.

The first line of every test case contains two integers nn (1n4,0001 \leq n \leq 4\\,000) and MM (1M10001 \leq M \leq 1000) -- the number of cuts and the cake's side length. The cake is a square with its opposing vertices located in points (0,0)(0, 0) and (M,M)(M, M).

Then follow nn lines, the ii-th of them containing three integers A_iA\_i, B_iB\_i and C_iC\_i (1000A_i,B_i1000,106C_i106,A_i2+B_i2>0-1000 \leq A\_i, B\_i \leq 1000, -10^6 \leq C\_i \leq 10^6, A\_i^2 + B\_i^2 > 0), which define the line equation A_ix+B_iy+C_i=0A\_ix + B\_iy + C\_i = 0 of the ii-th cut. 

More precisely, Alice is given a set of nn line equations. For each equation, she needs to replace the ==  operator with either \leq or \geq, obtaining a half-plane equation. The intersection of the cake with the sum of nn such half-planes is what Alice will be allowed to eat.

Each cut splits the cake into two parts of non-zero area each.

The total number of cuts in all test cases does not exceed 10,00010\\,000.

출력

For each test case output a single line containing a real number P (0P1000 \leq P \leq 100) with 6 decimal digits, followed by the '\%' sign -- the percentage of the cake which Alice will be able to eat if she chooses all sides of the cuts optimally. Your solution will be accepted if PP differs from the correct percentage by no more than 0.0000020.000002\\%.