A Greener World#1702

A Greener World

3 seconds
64 megabytes
Hard

Suppose there is a two-dimensional grid, but this grid is special: the grid lines are units apart instead of . If the grid is also skewed, it will look like the picture below (all squares have become rhombuses, and the angle between the coordinate axes is degrees, not degrees). The intersection of any two grid lines is called a lattice vertex.

Initially, trees are planted at the lattice vertices, shown as green dots in the picture above. Bill and Marsha have purchased a piece of land in this infinite grid world, shaped as a polygon whose vertices coincide with lattice vertices. After their purchase, the government of their country introduces a new law: "To make the landscape even greener, everyone must plant a tree at the center of each smallest rhombus." The locations for these new trees are shown as red circles in the figure above. Given the shape of Bill and Marsha's land, determine how many new trees must be planted within their property according to the new law. You may assume the trees have zero radius, and trees located on the boundary of the land are not considered to be planted by Bill and Marsha. OOPS! I forgot to mention that you also need to compute the area of their land.

Input

The input contains at most sets of data. Each set is described below:

Each set begins with three integers (0 < d < 10000), (44^\circ < \theta < 136^\circ), and . The values and are as described above, and denotes the number of vertices of the polygonal land. The next lines each contain two integers , (0 \leq x, y \leq 100000), giving the coordinates of the vertices of the polygonal land in order (clockwise or counterclockwise).

The input ends with a set where , , and are all zero.

Output

For each set of input, output two integers. The first is the number of new trees to be planted in Bill and Marsha's land, and the second is the area of their land, rounded to the nearest integer.

Examples

Example 1

Loading
Loading