Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! ![]()
Also: which Problem are you trying to solve?
Edit:
Guessing it’s this, in which case - consider the test input:
1
2 1 10
0 0