#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int N,Q;
    cin >> N >> Q;
    vector <int> A(N);
    vector <int> B(Q);

    for(int i=0;i<N;i++){cin >> A[i];}
    for(int i=0;i<Q;i++){cin >> B[i];}
    sort(A.begin(),A.end());

    for(int i=0; i<Q;i++){
        if(B[i]==A[N/2]){
            cout << "0"<<"\n";
            continue;
        }
        vector<int>::iterator broj=lower_bound(A.begin(), A.end(), B[i]);
        int broj2 = 0;
        if(N%2==0)broj2++;
        cout << broj2 + abs( ( (broj - A.begin()) - (N/2) - 1) *2 ) + 1 << "\n";
    }


    return 0;
}