Not able to understand the problem statement

Because, you guys haven’t explained the input format properly I believe I can solve that but not able to understand the input format.specially what is T and Li.

We have to paint n boards of length {A1, A2…An}. There are k painters available and each takes 1 unit time to paint 1 unit of board. The problem is to find the minimum time to get
this job done under the constraints that any painter will only paint continuous sections of boards, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}.

Input : k = 2, A = {10, 10, 10, 10}
Output : 20.
Here we can divide the boards into 2
equal sized partitions, so each painter
gets 20 units of board and the total
time taken is 20.

Input : k = 2, A = {10, 20, 30, 40}
Output : 60.
Here we can divide first 3 boards for
one painter and the last board for
second painter.

this problem is similar to book allocation problem
also try it

1 Like

I knew that but not able to understand that what is T and Li can you please tell me what are those input’s

I knew that but not able to understand that what is T and Li can you please tell me what are those input’s

T is no of testcases
Li is length of each board
k is no of painter
n is no of board

1 Like

so you mean Li will be same for all the boards i.e, if we have the T as 5. do you mean, that the number of board is 5 and the length of each board is 10 as the result we have the array as [10,10,10,10,10].

yes li is same as ai