we have y units of work and want to find out the minimum time required to finish the work

you will be given the sorted array arr[] where arr[i] denotes the time taken by ith person to do 1 unit of work

we have to find minimum time to fiish the work

4(total units of work)

3(total no of user)

1 1 2(0th person takes 1 second ,1st person takes 1 second,2nd person takes 2 seconds)

output

2

explanation

here if we allocate 1 unit of work to 0th person and 1st user at start then after 1 second 2 units of work will be completed again after 1 second if we allocate 1 unit of work to 0th and 1st person 2 units of work will be completed

so total 4 units in 2 seconds

so answer is 2

pls share approach

array is already sorted

this was asked in squad coding round on campus

@guitarlover @ssrivastava990 @anon55659401 @deeepeshthakur

pls help