Please go through the problem BOOKS1 Spoj. I figured out the following things and reached a state where I require your help:-
- I applied binary search over interval [max_element , sum_of_all_elements].
- then I calculate x = [lo + hi]/2 ;
- I check if I can partition the array in less than or equal to m parts such that no parts’ sum is greater than x;
- If I successfully completed this task I reduce hi to x and carry on;
The problem I face is there can be a case where I might not need exact k partitions (less than k might do) and output format such that first scriber’s work is least.
How do I go further?someone please help me.