Convex hull of the 3D - 1
n
points are given in the space. It is known that no 4 points lie in one plane. Find the convex hull of these points.
Input
The first line contains the number of tests m
. The following lines describe tests themselves. Each test case starts with a line containing n
(1 ≤ n ≤ 1000
) - the number of points. Further, the n
rows are given by three numbers - the points coordinates. All coordinates are integers and do not exceed 500. The total number of points does not exceed 22000.
Output
For each test case, the output is following. In the first line the number of edges m
should be printed. The next m
lines must describe the faces: the number of vertices and number of points in the original set. The points are numbered in the order in which they are given in the input file. Points within the faces must be sorted in order of counterclockwise relative to the outer normal to the face.