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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, q, x;
	cin >> n >> q;
	vector <int> a, b, c;
	for (int i = 0; i < n; i++){
		cin >> x;
		a.push_back(x);
    }
	for (int i = 0; i < q; i++){
		cin >> x;
		b.push_back(x);
    }
    sort (a.begin(), a.end());
	for (int i = 0; i < q; i++){
		x = 0;
		c.reserve(a.size());
		copy(a.begin(), a.end(), back_inserter(c));
		while (c[n / 2] != b[i]){
			x++;
			c.push_back(b[i]);
			sort (c.begin(), c.end());
		}
		cout << x << "\n";
		c.clear();
	}
    return 0;
}