eolymp
bolt
Try our new interface for solving problems
Problems

Entire

Entire

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. \InputFile The first line contains \textbf{N} (\textbf{3} ≤ \textbf{N}\textit{ }≤ \textbf{1000}) --- the number of vertices of the polygon. Next come the coordinates (\textbf{X_i}, \textbf{Y_i}) of vertices in the order of traversal in a clockwise direction. \textbf{X_i} and \textbf{Y_i} --- integers and do not exceed \textbf{1000000}. \OutputFile \textbf{K} --- the required number of points without leading zeros.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
1 1 1 -1 -1 -1 -1 1
Output example #1
1