ICPC 2005, Tokyo Region, Problem A