Fair distribution of oil wells

Revision en1, by harsh-apcr, 2024-05-11 14:31:51

There are Oil wells around an island, represented as an array A[] where A[i] is capacity of well i. There are N companies who bid for these wells. Now each company have to be allocated wells in contigous manner with fair distribution. A fair distribution one which minimises the difference of sum of capacity allocated to each of the company. Input array A[] of length n Output capacity[] of length N where capacity[i] represent total capacity allocated to company i.

Example: A = {25, 13, 17, 40, 8, 9, 22, 5} N = 4 capacity[0] = A[0] + A[7] = 30 ; Contigous as circular array capacity[1] = A[1] + A[2] = 30 capacity[2] = A[3] = 40 capacity[4] = A[4] + A[5] + A[6] = 39

Difference between minimum and max capacity[i] = 40 — 30 = 10

Any help in solving this problem is appreciated, unfortunately I don't have constraints available with me

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English harsh-apcr 2024-05-11 14:31:51 893 Initial revision (published)