2009-QR-Problem C. Welcome to Code Jam.