Job Execution
There are n jobs that can be executed in parallel on a processor, where the execution time
of the jth job is executionTime[j]. To speed up execution, the following strategy
is used.
In one operation, a job is chosen, the major job, and is executed for x seconds. All other jobs
are executed for y seconds where y < x.
A job is complete when it has been executed for at least executionTime[i] seconds, then it exits the pool. Find the minimum number of operations in which the processor can completely execute all the jobs if run optimally.
Complete the function getMinimumOperations in the editor below.
getMinimumOperations has the following parameters:
int executionTime[n]: the execution times of each jobint x: the time for which the major job is executedint y: the time for which all other jobs are executed
Returns
int: the minimum number of operations in which the processor can complete the jobs
1Example 1
Constraints
Limits and guarantees your solution can rely on.
- 1 ≤ n ≤ 105
- 1 ≤ executionTime[i] ≤ 109
- 1 ≤ y < x ≤ 109