#include <iostream>
#include<algorithm>

using namespace std;

int Median(int M[], int size)
{
    int x;
    x = M[size / 2];
    return x;
}

int MovesByAddingN(int M[], int Med, int size)
{
    int l;
    int counter = 0;
    bool T = false;
    while(T == false){
        int As[size + counter + 1];
        for(l = 0; l < size + counter + 1; l++){
            if (l < size){
            As[l] = M[l];
            }
            else{
                As[l] = Med;
            }
        }
        sort(As, As + size + counter + 1);
        if (Median(As, size + counter + 1) == Med){
            T = true;
        }
        counter++;
    }
    
    return counter;
}


int main()
{
    int n, q, i = 0;
    cin >> n >> q;
    int A[n];
    int B[q];
    
    for (i = 0; i < n; i++)
    {
        cin >> A[i];
    }
    for (i = 0; i < q; i++)
    {
        cin >> B[i];
    }
    sort(A, A + n);
    for (i = 0; i < q; i++){
        if (Median(A, n) == B[i]){
            cout << 0 << endl;
        }
        else
        {
            cout << MovesByAddingN(A, B[i], n) << endl;
        }
    }
}