Your value of MOD
is wrong.
Why did you change the long long
s to int
s?
The code fails for the Test Case
1
4 3
1 4
2 3
3 4
Correct Answer:- 1 4
Your Output:- 1 6
My AC code(using DFS):- CodeChef: Practical coding for everyone
2 Likes
Thanks.