using namespace std;
#include <string>
#include <iostream>
#include <sstream>
#include <utility>
#include <iterator>
#include <vector>
#include <array>
#include <cmath>
#include <algorithm>

double Median(vector<int>a, int n) {
	if (a.size() % 2 == 0) {
		nth_element(a.begin(), a.begin() + n / 2, a.end());
		nth_element(a.begin(), a.begin() + (n - 1) / 2, a.end());
		return (double)(a[(n - 1) / 2]+ a[n / 2])/ 2.0;
	}
	else {
		nth_element(a.begin(),a.begin() + n / 2,a.end());
		return (double)a[n / 2];
	}
}
int main() {
	string line0;
	getline(cin, line0);
	istringstream os0(line0);
	int i0;
	vector <int> t;
	while (os0 >> i0) {
		t.push_back(i0);
	}
	int na = t[0];
	int q = t[1];
	//
	vector <int> a;
	string line;
	getline(cin, line);
	istringstream os(line);
	int i;
	while (os >> i) {
		a.push_back(i);
	}
	//
	vector<int> b;
	string line1;
	getline(cin, line1);
	istringstream os1(line1);
	int i1;
	while (os1 >> i1) {
		b.push_back(i1);
	}
	int n = a.size();
	for (int i = 0; i < q; i++) {
		vector<int>w = a;
		double meda = Median(w, n);
		sort(w.begin(), w.end());
		int j = 0;
		while (meda != b[i]) {
			if (meda < b[i]) {
				int n = w.size();
				w.push_back(b[i]);
				double meda = Median(w, n);
				sort(w.begin(), w.end());
				if (meda == b[i]) {
					break;
				}
			}
			if (meda > b[i]) {

				w.push_back(b[i]);
				int n = w.size();
				double meda = Median(w, n);
				sort(w.begin(), w.end());
			}
			double meda = Median(w, n);
			int n = w.size();
			sort(w.begin(), w.end());
			j++;
		}
		cout << j << endl;
	}
}