Working fine on my local IDE

@abhishek8181
return ans from findpages() function. You are not returning anything from that.

test cases are failing

@abhishek8181

  1. if n<m no need to return 0, it is still possible as some students don’t need to read any book
  2. Inside the test cases loop you are doing return 0;, which will stop it after first iteration.
  3. Also remember to print new line after every test case.

Please mark the doubt as resolved if you understood this now.