The PDF version of this problem can be downloaded here.
2 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 1 2 2 3 3 4 4 5 5 6 6 7
1 2
Migrated from old NTUJ.
Hsinchu icpc 2011