Google Code Jam 2011 / Round 3 / Problem D (Small Only)