#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(n%2!=0){
            neparan = true;
        }
        while(median!=p){
            if(neparan){
                median+=1;
                br[i]+=1;
                neparan=false;
            }else{
                median+=1;
                br[i]+=2;
            }
        }
        cout << br[i] << endl;
    }
    return 0;
}