Not able to clear test cases in hacker blocks

Not able to clear test cases in hacker blocks.

Hello @king-slayer97 the range should be from book with the maximum number of pages to sum.
So find the book with maximum pages.
It is not necessary that the last book will be the only option.

hi, i tried what you said but still failing test cases.

code: https://ide.codingblocks.com/s/447471

@king-slayer97 check now:

no, it is giving wrong output

@king-slayer97 the code which i have shared with you is passing all the test cases:
where you are checking it?