My solution uses a binary search to determine the maximum number of books to be given to any scribe. After that I use simple backtracking to find a solution that minimizes the number of books for the first scribe, and then the second scribe and so on, making sure the maximum number of books given to any scribe does not exceed the value obtained.
I tried all the test cases I could find in the forums, and all of them agree with the output from my solution. But I keep getting a TLE, even with psyco.
I suspect that my backtracking approach in generating solutions is causing this. Can anyone suggest any way to speed this up or an alternate way to generate the answer?
Thanks in advance
MAK