1687. Smallest Bounding Rectangle

单点时限: 3.0 sec

内存限制: 256 MB

Given the Cartesian coordinates of n (> 0) 2-dimensional points, write a program that computes the area of their smallest bounding rectangle (smallest rectangle containing all the given points).

输入格式

The input file may contain multiple test cases. Each test case begins with a line containing a positive integer n (< 1001) indicating the number of points in this test case. Then follows n lines each containing two real numbers giving respectively the x- and y-coordinates of a point. The input terminates with a test case containing a value 0 for n which must not be processed.

输出格式

For each test case in the input print a line containing the area of the smallest bounding rectangle rounded to the 4th digit after the decimal point.

样例

Input
3
-3.000 5.000
7.000 9.000
17.000 5.000
4
10.000 10.000
10.000 20.000
20.000 20.000
20.000 10.000
0
Output
80.0000
100.0000

11 人解决,20 人已尝试。

22 份提交通过,共有 72 份提交。

6.4 EMB 奖励。

创建: 17 年,2 月前.

修改: 7 年,2 月前.

最后提交: 1 年,4 月前.

来源: UVa

题目标签