#include <iostream>
#include <algorithm>

using namespace std;

int nadjiBrojZaMedijanu(int a[], int n, int x){
    sort(a, a+n);
    int br = 0;

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

    return br;
}

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

    int a[n], b[q];

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

    for (int j = 0; j < q; j++)
        cin >> b[j];

    for (int i = 0; i < q; i++)
        cout << nadjiBrojZaMedijanu(a, n, b[i]) << endl;

    return 0;
}