#include <bits/stdc++.h>

using namespace std;

double medijana(vector<int> a, int n){
    sort(a.begin(),a.end());
    return (double)a[n/2];
} 


int main()
{
    int n,q;
    cin >> n >> q;
    vector<int> a;
    vector<int> b;
    
    a.resize(n);
    b.resize(q);
    
    for(int i = 0; i<n; i++){
        cin >> a[i];
    }  
    for(int i = 0; i<q; i++){
        cin >> b[i];   
    }
    
    
    double med = medijana(a,n);
    for(int i = 0; i<q; i++){
        vector<int> pom = a;
        int br=0;
        if(b[i] == med){
            cout << br <<"\n";
        }
        else{
            int br1 = n;
            while(medijana(pom,br1) != b[i]){
                br1++;
                pom.resize(br1);
                pom[br1-1] = b[i];
                br++;
            }
            cout <<br <<"\n";
        }
        
    }
    return 0;
}