You are given an array A of size N. You can perform an operation in which you will remove the largest and the smallest element from the array and add their difference back into the array. So, the size of the array will decrease by 1 after each oepration. You are given Q tasks and in each task, you are given an integer K. For each task, you have to tell sum of all the elements in the array after K operations.
Input:
First line contains two space-separated integers N and Q, denoting the number of elements in array and number of queries respectively.
Next line contains N space-separated integers denoting elements of the array.
Next Q lines contain a single integer K.
Output:
For each task, print answer in a new line.
Constraints:
2 <= N <= 105
1 <= Q <= 105
0 <= A[i] <= 109
0 <= K < N
After 1st operation, the array will become, A = [3,2,4,4]. So, sum of elements = 13.
After 2nd operation, the array will become, A = [3,2,4]. So, sum of elements = 9.