#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,q;
    cin >> n >> q;
    int a[n];
    bool neparan = false;
    for(int i = 0;i<n;i++){
        cin >> a[i];
    }
    sort(a,a+n);
    int br[q];
    for(int i = 0;i<q;i++){
        int x;
        cin >> x;
        int median = (n/2) + 1;
        br[i] = 0;
        int p = lower_bound(a,a+n,x)-a;
        p = p+1;
        if(median==p){
            cout << 0 << endl;
            continue;
        }
        if(n%2!=0){
            median+=1;
            br[i]+=1;
        }
        br[i]=br[i]+(p-median)*2;
        cout << br[i] << endl;
    }
    return 0;
}