2215. Starmap Drawing

单点时限: 2.0 sec

内存限制: 256 MB

Luke likes to draw maps of stars. Because he is a member of Greenpeace, he tries to avoid wasting paper. He has several sheets of paper in different sizes. For a given set of stars he looks for the smallest sheet he can fit the stars on.

Your task is to write a program to find the smallest sheet of paper (minimum area) needed to draw a complete set of stars without scaling up or down distances between the stars.

输入格式

The input consists of multiple sets of star maps.

The first line of each set contains a single integer (3<=n<=32767) indicating the number of stars in the set. The next lines contain n integer pairs of star coordinates (0 <= x,y <=32767) separated by either spaces or newlines.

Input is terminated by a set of size 0.

输出格式

For each set, you are to print a single line like Map N: W H, where N is the number of the set starting with 1 for the first map and always incremented by 1 for successive sets. W is the minimum width and H the minimum height of the paper needed to draw the map, each rounded up to the next integer greater or equal toW respectively H. The paper should always be in landscape format, which is wider than high. All numbers should be separated by exactly one space and each line should be terminated by a single newline.

样例

Input
5
0 4 2 4 1 2 0 0 2 0
4
1 2
3 2
0 0
2 0
0
Output
Map 1: 4 2
Map 2: 3 2

1 人解决,3 人已尝试。

1 份提交通过,共有 7 份提交。

9.9 EMB 奖励。

创建: 15 年,9 月前.

修改: 6 年,8 月前.

最后提交: 3 年,5 月前.

来源: TU Darmstadt Programming Contest 1999

题目标签