Solutions for USACO training program