spoj#KPPOLY. Projections Of A Polygon

    ID: 769 远端评测题 1000ms 1536MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>geometrybinary-searchbubble-cup-6-round-1

Projections Of A Polygon

本题没有可用的提交语言。

You are given a convex polygon on Cartesian coordinate system. It has projections on X and Y-axis. You can arbitrary rotate this polygon. What minimum and maximum sum of projections can you achieve?

Input

First line contains one integer number N (3 ≤ N ≤ 100) - number of polygon's vertices. Following N lines contain vertex coordinates Xi and Yi. All numbers are integers. Vertices are given in clockwise or anticlockwise direction. No two vertices coincide. No three consecutive vertices lie on the same line. All coordinates do not exceed 10000 by absolute value.

Output

Write minimum and maximum value of sum of the polygon's projections. Separate them by a space. Your answer should not differ with the correct one more than 10-6.

Example

Input:
4
0 0
0 1
1 1
1 0

Output:
2 2.828427124