ac usaco_2009dec_vidgame(maybe TLE at test No.10)