A Greener World
Suppose that there is a two-dimensional grid. But the grid is a bit special: the grid lines are d units apart instead of 1. If such a grid is skewed it will look like the grid shown in picture below (All the squares have become rhombuses and the angle between x-axis and y axis is theta instead of 90 degree). The intersection of any two grid lines is called a lattice vertex.
Initially trees are planted in all the lattice vertices shown with green circles in the picture above. Bill and Marsha buy a land of polygonal shape in this infinite lattice grid-land. All the vertices of the polygon are coincident with one of the lattice vertices. After Bill and Marsha buys the land the government issues a new law: "Two make the landscape even greener everyone must plant another plant at the center of each smallest rhombus". These new plants are shown with red circles in the picture above. Given the shape of the land of Bill and Marsha your job is to suggest them how many new trees must be planted by them within their land according to the new law imposed by the government? You can assume that on trees have zero radius and trees planted on the boundary of the land of Bill and Marsha are not considered inside the land. OOPS! I forgot to tell you that you also need to find out the area of the land of Bill and Marsha.
Input
The input file contains at most 15 sets of inputs. The description of each set is given below:
Each set starts with three integers d (0 < d < 10000), theta (44º < theta < 136º) and N. The meaning of d and theta is given in the problem statement and N denotes the number of vertices of the polygonal land. Each of the next N lines contains two integers x, y (0 ≤ x, y ≤ 100000) which denote the coordinate of a vertex of the polygonal shaped land. The coordinates of the vertices are given in clockwise or anti-clockwise order along the edges of the polygonal shaped land.
Input is terminated by a case where the value of d, theta and N are zero.
Output
For each set of input output two integers. The first integer denotes the number of new plants to be planted in the land of Bill and Marsha and the second integer denotes area of the land of Bill and Marsha rounded to the nearest integer.