Convex hull of the 3D - 3
Easy
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
Given n
points in space. No 4 points do not lie in one plane. Find the convex hull of these points.
Input
The first line contains the number n
(4 ≤ n ≤ 100
). Further, the n rows are given by three numbers - the coordinates of points. All coordinates are integers, do not exceed 500.
Output
In the first line of the output number of edges m
. Coming up next m
lines output description of 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.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 11%