Google Code jam Round C