usaco barn1. Greddy algorithm