Smallest Enclosing Box

There are n points in 3D space. You’re to find a smallest enclosing box of these points. By “smallest” we mean volume. Note that the sides of the box might not be parallel to the coordinate axes. Input There will be at most 10 test cases in the input. Each test case begins with a single integer n (4 ≤ n ≤ 10), the number of points. Each of the following n lines contains three integers x, y, z (−100 ≤ x, y, z ≤ 100), the coordinates of the points. The points will not be coplanar. The last test case is followed by a line with n = 0, which should not be processed. Output For each line, print the volume of the smallest enclosing box, rounded to two decimal places. Note: In the fourth example, the vertices of the minimal bounding box are: (9.33269, 4.89595, 7.61936), (2.62752, 2.26606, 7.37561) (9.70517, 4.62989, 0.243756), (3, 2, 0) (6.70509, 11.6301, 7.24374), (0, 9, 7) (7.07757, 11.3641, -0.131862), (0.372395, 8.73416, -0.375618) Sample Input 9 000 020 200 220 002 022 202 222 111 4 000 110 101 011 5 000 301 243 057 349 5 320 890

2/2 097 190 866 0 Sample Output 8.00 1.00 71.09 385.48