Fctre what the problem my code is 100% correct please help

https://www.codechef.com/viewsolution/31863818
Above is my code .I have checked the code in more than 100 cases.In all cases it gives correct result.But wrong answer on submit.Please help

It is the simplest approach in from all other solutions .
It is the code with using arrays only.

I think I found a testcase
1
18
10 5
10 11
10 15
10 14
1 6
1 7
7 8
1 4
2 6
6 3
18 8
12 5
4 13
4 12
17 9
9 8
16 17
4 4 15 17 16 24 1 14 13 7 13 50 36 12 19 12 12 7
1
10 17
Answer should be 792.
but your answer is giving 72.
Please forgive me if i have done any mistake in testing the solution or given an incorrect input.
Also this is my first post in codechef discuss :smile: .
Meanwhile I will try to see whats wrong.

1 Like

thanks bro it works

it works thanks

1 Like