Practice exercise from Google Code Jam