Mountain range
In Petryk's game, battles are set against a backdrop of a mountain range, which appears as a connected and convex set of pixels in the vertical direction, with its base parallel to the horizontal axis.
Vasya mentioned that this range is generated using a random number generator, which influences the battle process. Kolya believes that by analyzing the mountains closely, he can predict the battle's outcome. Specifically, he wants to determine the length of the mountain range from left to right (the number of pixels along the base) and the maximum height difference (the vertical distance between the highest and lowest pixel).
Input
The mountain range is described by its upper enclosing polyline, with each segment connecting adjacent pixels either horizontally, vertically, or diagonally. The first line contains an integer N (1 ≤ N ≤ 100000), representing the number of segments in the polyline. Each of the next N lines provides a pair of numbers x and y — the coordinates of the vector that defines each segment of the polyline (0 ≤ x ≤ 1, -1 ≤ y ≤ 1, x^2 + y^2 ≠ 0).
Output
Output two integers on a single line: the length of the mountain range and the maximum height difference.