Polyhedron#102

Polyhedron

5 seconds
64 megabytes
Hard

You are given a set of points in three-dimensional space. Your task is to determine, for each , how many faces with vertices the minimal convex polyhedron (convex hull) containing all the given points has.

Input

The first line contains the number of test cases (1 \leq T \leq 100). Each test case begins with a line containing the number of points (4 \leq N \leq 30). Each of the next lines contains three integers: , , (-1000 \leq X, Y, Z \leq 1000) — the coordinates of a point. Some points may coincide! It is guaranteed that any convex polyhedron containing all the given points has positive volume.

Output

For each test case, output a line in the format "Case #:", where is the test number (starting from ), followed by more lines, where is the number of distinct face types (the type of a face is determined by the number of its vertices).

On each of the following lines, output two numbers: — the number of vertices in a face, and q_k — the number of faces with vertices in the polyhedron. After , print a colon ":", a space, and then q_k. Output the results in increasing order of .

The number of vertices of a face is determined geometrically: if a given point lies on the edge of a face, it is not counted as a vertex; if several points coincide at the same vertex, they are counted as one vertex.

Examples

Example 1

Loading
Loading