using System;
using System.Collections.Generic;
using System.Collections;
namespace ConsoleApp1
{
    internal class Program
    {

        static List<int> Citaj(string[] ulaz, int n)
        {
            List<int> niz = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                niz.Add(int.Parse(ulaz[i]));
            }
            return niz;
        }
        static int Medijana(List<int> lista)
        {
            lista.Sort();
            int n = lista.Count;
            return lista[n / 2];
        }
        static int brDodatih(List<int> niz, int x, int dodati)
        {
            niz.Sort();
            int n = niz.Count;
            int veci = 0, manji = 0, jednaki = 0;
            if (Medijana(niz) == x)
                return 0;
            for (int i = 0; i < n; i++)
            {
                if (niz[i] < x)
                    manji++;
                else if (niz[i] > x)
                    veci++;
                else jednaki++;
            }
            if (jednaki == 0)
            {
                niz.Add(x);
                dodati++;
                return brDodatih(niz, x, dodati);
            }
            if (manji > veci)
                return dodati + manji - veci - 1;
            else return dodati + veci - manji;
        }
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split();
            int n = int.Parse(ulaz[0]);
            int q = int.Parse(ulaz[1]);
            List<int> a = Citaj(Console.ReadLine().Split(), n);
            List<int> b = Citaj(Console.ReadLine().Split(), q);
            for (int i = 0; i < q; i++)
            {
                Console.WriteLine(brDodatih(a, b[i], 0));
            }
        }
    }
}