Safe Places 

There are n kinds (i.e. type-1, type-2, ..., type-n) of m satellites in the space. For each 1$ \le$i$ \le$n, all the type-i satellites are working together to protect their minimal enclosing convex polyhedron (though its volume might be zero). If a point is protected by at least k kinds of satellites, we say this point is safe.

Find the volume of all safe places (it might be zero).

Input 

The first line contains T (T$ \le$25), the number of test cases. Each test case begins with three integers n, k and m ( 1$ \le$k$ \le$n$ \le$5, 4$ \le$m$ \le$50). Each of the following m lines contains an integer t and three real numbers x, y, z, representing a type-t satellite at (x, y, z) ( 1$ \le$t$ \le$n, 0$ \le$x, y, z$ \le$10). Each test case is terminated by a blank line


Note: The coordinates of satellites in the judge input (not sample input) are randomly generated.

Output 

For each test case, print the volume rounded to 5 decimal places after the decimal point.

Sample Input 

2
2 1 16
1 0 0 0
1 0 0 2
1 0 2 0
1 0 2 2
1 2 0 0
1 2 0 2
1 2 2 0
1 2 2 2
2 1 1 1
2 1 1 3
2 1 3 1
2 1 3 3
2 3 1 1
2 3 1 3
2 3 3 1
2 3 3 3

1 1 4
1 0 0 0
1 0 1 0
1 0 0 1
1 1 0 0

Sample Output 

15.00000
0.16667



Problemsetter: Rujia Liu, Special Thanks: Md. Mahbubul Hasan