A rectangle enclosing a set of points is valid if:
Now given a set of points on the x-y plane, find their enclosing rectangle of minimum/maximum area respectively.
Input contains multiple testcases, and is terminated by EOF.
In each of the testcases, an integer N (3<=n<=100000) describes the number of points. The following N lines each contain two integers describing the coordinate of the points. (0 <= |xi|,|yi| <= 107).
You can assume that there will be no testcase with all points collinear.
For each testcase, output the answer in the following format:
Case #(case_id):
Minimum area = (min_enclosing_area)
Maximum area = (max_enclosing_area)
Print a blank line after each testcase.
3 -3 5 7 9 17 5 4 10 10 10 20 20 20 20 10
Case #1: Minimum area = 80.000 Maximum area = 200.000 Case #2: Minimum area = 100.000 Maximum area = 200.000
Info: 本題輸出為浮點數,絕對或相對誤差 1e-4 以下視為正確
Migrated from old NTUJ.
IMPROVED from ACM World Finals 2000, Problem D
No. | Testdata Range | Score |
---|