- Time limit: 1.00 s
- Memory limit: 512 MB
Given a polygon, your task is to calculate the number of lattice points inside the polygon and on its boundary. A lattice point is a point whose coordinates are integers.
The polygon consists of vertices . The vertices and are adjacent for , and the vertices and are also adjacent.
Input
The first input line has an integer : the number of vertices.
After this, there are lines that describe the vertices. The th such line has two integers and .
You may assume that the polygon is simple, i.e., it does not intersect itself.
Output
Print two integers: the number of lattice points inside the polygon and on its boundary.
Constraints
Example
Input:
4 1 1 5 3 3 5 1 4
Output:
6 8