
You are given a 0-indexed array nums of size n consisting of positive integers.
You are also given a 2D array queries of size m where queries[i] = [index _i , k _i ] .
Initially all elements of the array are unmarked .
You need to apply m queries on the array in order, where on the i ^th query you do the following:
Mark the element at index index _i if it is not already marked.
Then mark k _i unmarked elements in the array with the smallest values. If multiple such elements exist, mark the ones with the smallest indices. And if less than k _i unmarked elements exist, then mark all of them.
Return an array answer of size m where answer[i] is the sum of unmarked elements in the array after the i ^th query .
n == nums.lengthm == queries.length1 <= m <= n <= 10 ^51 <= nums[i] <= 10 ^5queries[i].length == 20 <= index _i , k _i <= n - 1