Official Analysis

Solution 1 (Casework)

Solution

Other Solutions

See the Rectangle Geometry module.

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!