Chef and Polygons
Chef has a [simple polygon](https://en.wikipedia.org/wiki/Simple_polygon) with $N$ vertices on the 2D-coordinate plane - $(X_1, Y_1), (X_2, Y_2), \ldots, (X_N, Y_N)$ . He wants to find the number of points $(X, Y)$ that lie on the polygon's perimeter where $X$ and $Y$ are integers, and $X+Y$ is a prime number. ### Input - The first line of input contains a single integer $N$, denoting the number
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start