lazer codechef

C
1
4 3
1 3 5 1
2 4 4
1 2 3
1 4 1

Source

Also in C: