#include <bits/stdc++.h>
using namespace std;

int main(){
    int N, Q;
    cin >> N >> Q;
    vector <int> A;
    vector <int> B;
    int a, b;
    for(int i = 0; i < N; i++){
        cin >> a;
        A.push_back(a);
    }
    for(int i = 0; i < Q; i++){
        cin >> b;
        B.push_back(b);
    }
    sort(A.begin(), A.end());


    for(int i = 0; i < Q; i++){
        vector <int> C = A;
        int br = 0;
        while(C[floor((N + br) / 2)] != B[i]){
            C.push_back(B[i]);
            sort(C.begin(), C.end());
            br++;
        }
        cout << br << "\n";
    }

}