ac usaco_2006open_events again (better solution)