Here is the homework problem for this week: http://www.usaco.org/index.php?page=viewproblem2&cpid=963. It is another problem where you can use brute force to find the solution, so try to implement a solution that does so.