Painter's Partition Problem

How do we solve this problem for k<n ?

  1. How do we divide the work among painters for n=5 and k=2 ? lets say n1=1, n2=2, n3=3, n4=4, n5=5.
  2. If it is possible that one painter has completed work of one board and started painting other board while second painter is still painting his board as it has more length ?

Hi Ekram,
Yes it is possible that one painter has completed of one work and started other board while other painter still paints his board. You can use binary search on this question. Worst case time taken would be equal to total area of all the boards.

For:
k=2 and n=5 where n: 1,2,3,4,5.
The answer will be 9.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.