0092. Convex Hull

Input file name: conhull.in
Output file name: conhull.out
Time limit: 2 s
Memory limit: 64 megabytes

Your task is to find the surface area and the volume of the convex hull of given N spheres of radius R.

Input file

First line contains two integer numbers 1 ≤ N ≤ 50 and 1 ≤ R ≤ 239. The next N lines are filled with coordinates of points in format xi yi zi. Coordinates are real numbers that do not exceed 1000 by an absolute value.

Output file

Output two real numbers with six digits after decimal point – the surface area and the volume.

Examples:

conhull.inconhull.out
8 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 137.415927 20.613568


Source: Petrozavodsk Winter 2003. Final Contest, Saturday, February 08

Discuss       Submit a solution



Printable version