algorithms from USACO