시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 19 8 8 42.105%

문제

You just bought a large piece of agricultural land, but you noticed that – according to regulations – you have to test the ground water at specific points on your property once a year. Luckily the description of these points is rather simple. The whole country has been mapped using a Cartesian Coordinate System (where (0, 0) is the location of the Greenwich Observatory). The corners of all land properties are located at integer coordinates according to this coordinate system. Test points for ground water have to be erected on every point inside a property whose coordinates are integers.

입력

The input consists of:

  • one line with a single integer n (3 ≤ n ≤ 100 000), the number of corner points of your property;
  • n lines each containing two integers x and y (−106 ≤ x, y ≤ 106), the coordinates of each corner.

The corners are ordered as they appear on the border of your property and the polygon described by the points does not intersect itself.

출력

The number of points with integer coordinates that are strictly inside your property.

예제 입력 1

4
0 0
0 10
10 10
10 0

예제 출력 1

81