Only Integers Allowed
Practice
3.7 (139 votes)
Geometry
Open
Approved
Easy Medium
Problem
71% Success 2842 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

See Russian translation

You have a polygon described by coordinates of its vertices. Can you find how many points with integer coordinates lay strictly inside it?

Input
The first line contains an integer N - number of vertices. Next N lines contain 2 space-separated integers each and describe polygon vertices in clockwise order. Note that polygon can be convex and non-convex as well.

Output
Output one integer - answer for the problem

Constraints

  • 3 <= N <= 1000
  • |xi|, |yi| <= 106

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
No similar problems found