Google Codejam 2010 Round 1B Problem A.