Entire
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Polygon on the plane is given coordinates of its vertices. Required to count the number of points with integer coordinates that lie strictly within it.
Input
The first line contains N (3 ≤ N ≤ 1000) — the number of vertices of the polygon. Next come the coordinates (X_i, Y_i) of vertices in the order of traversal in a clockwise direction. X_i and Y_i — integers and do not exceed 1000000.
Output
K — the required number of points without leading zeros.
Examples
Input #1
Answer #1
Submissions 589
Acceptance rate 21%