#include <iostream>
#include <algorithm>

using namespace std;

int nadjiBrojZaMedijanu(int a[], int pom[], int n, int x){
    sort(a, a+n);
    int br = 0;
    pom[n] = a[n];
    for (br = 0; a[n/2] != x; br++){
        a[n++] = x;
        sort(a, a+n);
    }
    copy (pom, pom+n, a);

    return br;

}

int main()
{
    int n, q;
    cin >> n >> q;

    int a[n], b[q];

    int pom[n];

    for (int i = 0; i < n; i++){
            cin >> a[i];
            pom[i] = a[i];
    }

    for (int j = 0; j < q; j++){
        cin >> b[j];
        cout << nadjiBrojZaMedijanu(a, pom, n, b[j]) << endl;

    }

    return 0;
}