INPUT: positive integers with
OUTPUT: 1, if you can partition the input into three parts, each with sum L/3 and 0 otherwise.
Note that each number must be in exactly one of the three partitions.
INPUT: positive integers with
OUTPUT: 1, if you can partition the input into two parts, each with sum L/2
As an example, assume that the input
was
R = 3, 4, 0, 5, 2, 7 (so n=6) and k=3.
Then one possible solution (there is no claim
that this is the optimal solution) would be to broadcast
at times 2, 4, and 7 (note that it is obvious that in every
optimal schedule that there is a broadcast at time
n+1 if ).
The 3 requests at time 1 would then have to wait 1 time unit.
The 4 requests at time 2 would then have to wait 2 time units.
The 5 requests at time 4 would then have to wait 3 time units.
The 2 requests at time 5 would then have to wait 2 time units.
The 7 requests at time 6 would then have to wait 1 time units.
Thus the total waiting time for this solution would be