You shall never get it
Code
# Code
```python3 []
from typing import List

class Solution:
    def minOperations(self, nums: List[int], queries: List[int]) -> List[int]:
        nums.sort()
        res = []
        prefix = [0]

        for i in nums:
            prefix.append(prefix[-1] + i)

        def getindex(num):
            left, right = 0, len(nums) - 1
            while left <= right:
                mid = left + (right - left) // 2
                if nums[mid] < num:
                    left = mid + 1
                else:
                    right = mid - 1
            return left

        for number in queries:
            index = getindex(number)
            left_sum = number * index - prefix[index]
            right_sum = (prefix[-1] - prefix[index]) - number * (len(nums) - index)
            res.append(left_sum + right_sum)

        return res

```
['Python3']