Convex hull 3D - 1#1833

Convex hull 3D - 1

1 second
256 megabytes
Medium

points are given in space. No four points lie in the same plane. Find the convex hull of these points.

Input

The first line contains — the number of test cases. The following lines describe the tests. Each test starts with a line containing (1 \leq n \leq 1000) — the number of points. Then, lines follow, each with three integers — the coordinates of the points. All coordinates are integers with absolute value at most . The total number of points does not exceed .

Output

For each test case, print the following. In the first line, print the number of faces . In the next lines, provide the description of each face: the number of vertices and the indices of the points in the given set. Points are numbered in the order they appear in the input file. Within each face, the points must be listed in counterclockwise order relative to the outer normal of the face.

Examples

Example 1

Loading
Loading