#include <iostream>
#include <cmath>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;
int main(int argc, char** argv) {
	
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int n,m,k;
	vector<int> a;
	cin>>n>>m;
	for (int i=0;i<n;i++){
		cin>>k;
		a.push_back(k);
	}
	sort(a.begin(),a.end());
	int p,x,medijana;
	for (int i=0;i<m;i++){
		cin>>x;
		medijana=a[n/2];
		if (x<medijana){
			p=distance(a.begin(),upper_bound(a.begin(),a.end(),x));
			if (a[p-1]==x) p--;
		}
		else if (x>medijana) p=distance(a.begin(),lower_bound(a.begin(),a.end(),x));
		//cout<<p<<" "<<a[p]<<'\n';
		//cout<<a[(n/2)]<<"\n";
		if (x==medijana) cout<<"0\n";
		else cout<<abs(p*2-n)<<'\n';
		
	}
	
	
	
	return 0;
}