#C3765. Smallest Enclosing Rectangle Area

    ID: 47228 Type: Default 1000ms 256MiB

Smallest Enclosing Rectangle Area

Smallest Enclosing Rectangle Area

Given a set of points on the 2D plane, your task is to compute the area of the smallest axis-aligned rectangle that encloses all these points. The rectangle is aligned with the coordinate axes, meaning its sides are parallel to the x-axis and y-axis. Mathematically, if the points have x-coordinates between (x_{min}) and (x_{max}) and y-coordinates between (y_{min}) and (y_{max}), then the area (A) of the rectangle can be computed as: [ A = (x_{max} - x_{min}) \times (y_{max} - y_{min}) ] If there is only one point, the area is considered to be 0.0.

inputFormat

The first line of input contains an integer (N) denoting the number of points. Each of the following (N) lines contains two space-separated integers representing the x and y coordinates of a point.

outputFormat

Output a single line containing the area of the smallest enclosing rectangle. The result should be printed as a floating-point number with exactly 15 decimal places.## sample

1
0 0
0.000000000000000