USACO 2017 Gold February P2. Why Did the Cow Cross the Road II