MathsReadCompetitive mathematics
Algorithmic puzzle · integer answerhard90 min

Interior lattice points of a survey polygon

Lattice Geometry

A simple polygon has vertices (2,2), (70,9), (88,47), (51,96), (12,80), in that cyclic order. How many integer lattice points lie STRICTLY inside it (not on its boundary)?

Solve using mathematics, algorithms, or your own code offline. Submit only the final integer here—no program, expression, graph, or written proof.

Check your answer without signing in. Sign in to save your progress.

Accepted format: a whole number such as 42 or 123456789. No commas, formulas, or source code.

How to approach this problem

Compute twice the area with the shoelace formula. Sum gcd(|Δx|,|Δy|) over the edges to count boundary lattice points; then apply Pick’s theorem I = A−B/2+1. Retain integer arithmetic by doubling the formula.

Worked example with different values

A 3-by-2 lattice rectangle has area 6 and boundary count 10, giving 6−5+1=2 interior lattice points.

Apply the same reasoning to the challenge. This example is a separate practice problem.

Learn the technique: Number theory: divisors, gcd and modular arithmetic

Report a question or explanation issue

Back to problems →