首页 > 代码库 > 此坑待填 离散化思想和凸包 UVA - 10173 Smallest Bounding Rectangle
此坑待填 离散化思想和凸包 UVA - 10173 Smallest Bounding Rectangle
Smallest Bounding Rectangle
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).
Input
The input le 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.
Output
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.
Sample 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
Sample Output
80.0000
100.0000
给定平面上n个点的坐标,求能够覆盖所有这些点的最小矩形面积。这个问题难就难在,这个矩形可以倾斜放置(边不必平行于坐标轴)。
此坑待填 离散化思想和凸包 UVA - 10173 Smallest Bounding Rectangle