ICPC 2009 Asia Region, Problem A