Solution for USACO problems