eolymp
bolt
Try our new interface for solving problems
Problems

Polyhedron

Polyhedron

You are given a set of points in 3-D space. Your task is to calculate the number of \textbf{k} vertex sides of the convex polyhedron with minimal volume that contains the whole given set of points. \InputFile First line of input contains the quantity of tests \textbf{T} (\textbf{1} ≤ \textbf{T} ≤ \textbf{100}). First line of each test case contains the number of points in given set \textbf{N} (\textbf{4} ≤ \textbf{N} ≤ \textbf{30}). Then \textbf{N} lines follow, each of which contains \textbf{3} integer numbers: \textbf{X}, \textbf{Y}, \textbf{Z} (\textbf{--1000} ≤ \textbf{X}, \textbf{Y}, \textbf{Z} ≤ \textbf{1000}) -- coordinates of points. Some points can have the same coordinates! It’s guaranteed, that any convex polyhedron, that contains all given points, has a positive volume. \OutputFile For each of \textbf{T} test cases output a line of the form "\textbf{Case} #\textbf{A}:", where \textbf{A} is the number of test (beginning from \textbf{1}), and then -- \textbf{M} more lines, where \textbf{M} is the quantity of different side types (a side type means quantity of its vertices). In each of the next \textbf{M} lines you have to output two numbers: \textbf{k} -- the number of vertices in the side and \textbf{q_k} -- the number of \textbf{k} vertex sides in the polyhedron. After \textbf{k} you must print a colon ":" and then -- a space. You have to output the result in ascending order of \textbf{k}. The quantity of vertices in a side is determined only by geometrical meanings. That is, if a given point lies on an edge of a side, it mustn’t be considered as a vertex, and if some such point lie in one vertex, they must be considered as a single vertex.
Time limit 5 seconds
Memory limit 64 MiB
Input example #1
2
6
0 0 0
2 0 0
0 2 0
2 2 0
3 1 0
1 1 1
5
0 0 0
1 1 0
0 2 0
2 1 0
1 1 1
Output example #1
Case #1:
3: 5
5: 1
Case #2:
3: 4