#include <iostream>
#include <cmath>
using namespace std;

class Votes
{
	private:
		int N, Q;
	
	public:
		Votes() {}
		
		Votes(int N, int Q)
		{
			this->N = N;
			this->Q = Q;
		}
		
		inline void minVotesForNewMedian()
		{
			int A[N], B[Q];
			
			for (int i = 0; i < N; i++)
			{
				cin >> A[i];
			}
			
			for (int i = 0; i < Q; i++)
			{
				cin >> B[i];
			}
			
			for (int i = 0; i < N-1; i++)
			{
				for (int j = i+1; j < N; j++)
				{
					int t;
					if (A[i] > A[j])
					{
						t = A[i];
						A[i] = A[j];
						A[j] = t;
					}
				}
			}
			int median = A[(N/2)];
			
			for (int i = 0; i < Q; i++)
			{
				int e = 0, g = 0, s = 0;
			    for (int j = 0; j < N; j++)
				{
			        if (A[j] == B[i]) e++;
			        else if (A[j] > B[i]) g++;
					else if (A[j] < B[i]) s++;
			    }
			 
			    int minVotes = 0, ans = 0;
			    if (g > s) ans = g - s;
			    else if (g < s) ans = s - g - 1;
			    
			    minVotes = ans + 1 - e;
			    cout << endl << minVotes;
			}
		}
};

int main()
{
	int N, Q;
	
	cin >> N;
	cin >> Q;
	
	Votes V(N, Q);
	V.minVotesForNewMedian();
	
	return 1;
}