#C3952. Smallest Bounding Cuboid Volume

    ID: 47436 Type: Default 1000ms 256MiB

Smallest Bounding Cuboid Volume

Smallest Bounding Cuboid Volume

Given n points in 3D space, your task is to compute the smallest volume of an axis-aligned cuboid that can enclose all the points. The cuboid's volume is computed as \(V = (\max x - \min x) \times (\max y - \min y) \times (\max z - \min z)\). Note that if there is only one point, the volume is defined as 0.

inputFormat

The input is read from standard input (stdin). The first number is an integer n (\(n \ge 1\)) denoting the number of points. This is followed by 3\(n\) integers representing the coordinates of each point in the order: x, y, z.

outputFormat

Output a single floating point number to standard output (stdout) representing the volume of the smallest cuboid that can enclose all given points. The answer must be printed with exactly six digits after the decimal point.

## sample
3 1 2 3 4 5 6 7 8 9
216.000000