Google Code Jam 2009 / World Finals / Problem D