hello ! I was solving this problem from Codechef
I think that the solution on the editorial is wrong and it should fail this exemple :
1 3 1
1 2 1
2 4 1
3 5 2
4 5 2
4 6 3
the answer is 33 while the tester's algorithm output 34
Am I wrong ?
EDIT : you can find the tester's solution at the end of the Editorial
As this is a problem from CodeChef,
Wouldn't it be better to raise a question on the CodeChef Forum?
In fact I asked the question in the Editorial page and didin't get any answer as for the forum I can not ask a quetion because I don't have enough Karma (contribution)