#include <iostream>

using namespace std;

int main()
{
	int b[100];
	int a[100];

	unsigned n, q;
	cin >> n >> q;

	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}

	for (int i = 0; i < q; i++)
	{
		cin >> b[i];
	}

	int s = 0;
	for (int i = 0; i < q; i++)
	{
		for (int j = 0; j < n; j++)
		{
			s += a[j];
		}
		s / n;
		
		if (s == b[i]) { cout << "0" << endl; }
		else if (s < b[i])
		{
			int x;
			x = 2 * (b[i] - s / 2);
			if (x < b[i]) { cout << x << endl; }
			else if (x % b[i] == 0) { cout << x / b[i] << endl; }
			else { cout << x / b[i] + 1 << endl; }
		}
	}

	return 0;
}