What is wrong in my code

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

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
1 Like