#include "bits/stdc++.h"
#define ll long long
#define pb push_back
using namespace std;


void solve() {
    ll n,q;
    cin>>n>>q;
    ll a[n],b[q];
    for(int i=0;i<n;i++){
        cin>>a[i];
    } 
    for(int i=0;i<q;i++){
        cin>>b[i];
    }
    ll pre,duz;
    for(int i=0;i<q;i++){
        pre=0;
        duz=0;
        for(int j=0;j<n;j++){
            if(a[j]<b[i])pre++;
            if(a[j]==b[i])duz++;
        }
        if(n/2+1>pre&&n/2+1<=pre+duz)cout<<0<<endl;
        else if(pre<=n-(pre+duz)) cout<<(n/2+1-(pre+duz))*2-(1-n%2)<<endl;
        else cout<<2*pre-n<<endl;
    }
}

int main () {
    int t=1;
    /*
    cin>>t;
    //*/
    while(t--) {
        solve();
    }
}