5 10 40 40 70 20 50 30 60 30 60 20 50 45 70 10 40 45 70 10 40 25 55 35 55 35 45 55 25 65 25 0 This is an extremely difficult test case that ((un)fortunately?) was not included in the judges' input. Correct output should be: Heap 1 (C,3) As far as I have seen, only the solutions of Roma 1 and Genova 1 are able to handle this case. Congratulations to these two teams! Mark Dettinger Regional Contest Director