Book allocation problem in searching

https://ide.codingblocks.com/s/168587 why this code dont passed all test cases??..what is the problem in this code?

You havent used endl after every test case, I have edited your code… try to submit your code now…