USACO 2018 Gold February P3. Taming the Herd