AdvancedRating 1800
Grid Points Inside a Polygon
A simple polygon has corners at integer points (given in order). Count the integer points strictly inside it. Use Pick's theorem.
Input
n, then n lines 'x y'.
Output
One integer.
Sample 1
Input
4 0 0 4 0 4 4 0 4
Output
9
Sample 2
Input
3 0 0 2 0 0 2
Output
0
Output appears here