Process Execution
Amazon Web Services (AWS) has millions of servers that provide on-demand cloud computing platforms to the customers.
In one AWS center, there are nprocesses to be executed and m processors to execute them. The ith process requires power[i] for execution. A processor can provide power within its range minPower through maxPower[i]. Process i can be executed on processor j if minPower[j] ≤ power[i] ≤ maxPower[j].
Given the power consumption of n processes, the range of processor power in m processors, find:
Complete the function processExecution in the editor.
amazon-process-executionm
processExecution has the following parameters:
int power[n]: the power consumption of processesint minPower[m]: the minimum bounds of the ranges of processor powerint maxPower[m]: the maximum bounds of the ranges of processor power
Returns
long_int[m][2]: the #th element of this array consists of 2 integers - the number of processes that lie within the range of the #th processor, and the sum of the power consumption of those processes.
𓇢𓆸 🌷Credit to ʚ Mira ɞ ᯓᡣ𐭩。˚🌷
1Example 1

2Example 2
Constraints
Limits and guarantees your solution can rely on.
- 1 ≤ n ≤ 12 * 10^5
- 1 ≤ m ≤ 2 * 10^5
- 1 ≤ power[i] ≤ 10^8
- 1 ≤ minPower[i] ≤ maxPower[i] ≤ 10^8