Google Code Jam lunch work, matching digonals