#include <iostream>
#include <cstdio>
#include <algorithm>
#define maxN 1000001
using namespace std;
int n , k , a[maxN];
long long total;
int cuttree(int tree)
{
return total - (tree*n);
}
int Solve(int h)
{
int i = 1 , j = a[n] , mid , x;
while(i <= j)
{
mid = (i+j)/2;
x = cuttree(a[mid]);
if (x > h)
j = mid-1;
else i = mid+1;
}
return x;
}
void ReadData()
{
int h;
cin >> n >> k;
for (int i = 1; i <= n; ++i){
cin >> a[i];
total = total + a[i];
}
sort(a+1 , a+n+1);
while(--k){
cin >> h;
cout << Solve(h) << "\n";
}
}
int main()
{
ReadData();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojZGVmaW5lIG1heE4gMTAwMDAwMQp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbiAsIGsgLCBhW21heE5dOwpsb25nIGxvbmcgdG90YWw7CgppbnQgY3V0dHJlZShpbnQgdHJlZSkKewogICAgcmV0dXJuIHRvdGFsIC0gKHRyZWUqbik7Cn0KCmludCBTb2x2ZShpbnQgaCkKewogICAgaW50IGkgPSAxICwgaiA9IGFbbl0gLCBtaWQgLCB4OwogICAgd2hpbGUoaSA8PSBqKQogICAgewogICAgICAgIG1pZCA9IChpK2opLzI7CiAgICAgICAgeCA9IGN1dHRyZWUoYVttaWRdKTsKICAgICAgICBpZiAoeCA+IGgpCiAgICAgICAgICAgIGogPSBtaWQtMTsKICAgICAgICBlbHNlIGkgPSBtaWQrMTsKICAgIH0KICAgIHJldHVybiB4Owp9Cgp2b2lkIFJlYWREYXRhKCkKewogICAgaW50IGg7CiAgICBjaW4gPj4gbiA+PiBrOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgKytpKXsKICAgICAgICBjaW4gPj4gYVtpXTsKICAgICAgICB0b3RhbCA9IHRvdGFsICsgYVtpXTsKICAgIH0KICAgIHNvcnQoYSsxICwgYStuKzEpOwogICAgd2hpbGUoLS1rKXsKICAgICAgICBjaW4gPj4gaDsKICAgICAgICBjb3V0IDw8IFNvbHZlKGgpIDw8ICJcbiI7CiAgICB9Cn0KCmludCBtYWluKCkKewogICAgUmVhZERhdGEoKTsKICAgIHJldHVybiAwOwp9Cg==