using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ConsoleApp15
{
    internal class Program
    {
        public static double Medijana(double[] niz1)
        {
            List<double> niz = niz1.ToList();
            niz.Sort();
            if(niz.Count%2 == 1)
                return niz[(niz.Count-1)/2];
            else if(niz.Count%2 == 0)
                return (niz[niz.Count/2 -1] + niz[niz.Count/2])/2;
            return 0;
        }
        public static int brDoMedijane(double[] niz1, double br)
        {
            List<double> niz = niz1.ToList();
            int num = 0;
            while(Medijana(niz.ToArray()) != br)
            {
                niz.Add(br);
                num++;
            }
            if (num > 0)
                return num - 1;
            else
                return 0;
        }


        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int n = int.Parse(str[0]);
            int q = int.Parse(str[1]);

            string[] s = Console.ReadLine().Split();
            string[] r = Console.ReadLine().Split();
            double[] niz = new double[n];

            for(int i = 0;i<n;i++)
                niz[i] = double.Parse(s[i]);

            for(int k =0;k<r.Length;k++)
            {
                int medijana = int.Parse(r[k]);
                Console.WriteLine(brDoMedijane(niz, medijana));
            }


        }
    }
}