Solve Code Jam 2008 Round 1A problem A