#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
    int n, q, index;
    cin >> n >> q;
    vector<long int> a;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a.push_back(x);

    }
    sort(a.begin(), a.end());
    for (int i = 0; i < q; i++) {
        int b;
        cin >> b;
        int c = a[n/2];
        if (b == c) {
            cout << 0 << endl;
        }
        else {
            //          int j;
             //          vector<int>::iterator j;
            decltype(a)::iterator it = lower_bound(a.begin(), a.end(), b);
            int k = (it - a.begin());
            int r = 2 * k - n;
            if (r < 0) r = abs(r) - 1;
            cout << r << endl;
        }
    }
}