Not Able to understand why still the submission is failing? (LECANDY)

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

Edit:

Consider the testcase:

2                     
10 1000000000
1 2 3 4 5 6 7 8 9 10
5 105 
10 10 10 10 11
1 Like