using System;

namespace masoasd
{
    class Program
    {

        public static int namestiGlasanje(int [] A,int index, int Q, int mediane)
        {
            int br = 0;
            int brr = 1;
            if (mediane == Q) return 0;

            while(mediane != Q)
            {
                int[] AA = new int[A.Length + brr];
                for (int i = 0; i < A.Length; i++)
                {
                    AA[i] = A[i];
                    
                }
                //ispisiNiz(AA);
                for (int i = A.Length; i < A.Length+brr-1; i++)
                {
                    AA[i] = Q;
                }

                br++;
                //ispisiNiz(AA);
                if (AA[AA.Length / 2] == Q) mediane = AA[AA.Length/2];

                brr++;
            }
            return br;
        }
         
        public static void ispisiNiz(int [] a)
        {
            for (int i = 0; i < a.Length; i++)
            {
                Console.Write(a[i] + ",");
            }
        }
        static void Main(string[] args)
        {
            var unos = Console.ReadLine();
            var vrednosti = unos.Split(" ");
             int N = int.Parse(vrednosti[0]);
            int Q = int.Parse(vrednosti[1]);
            int[] A = new int[N];
            int[] B = new int[Q];


            var unosNiza = Console.ReadLine();
            var vrednostiNiza = unosNiza.Split(" ");
            for (int i = 0; i < A.Length; i++)
            {
                A[i] = int.Parse(vrednostiNiza[i]);
            }

            Array.Sort(A);

            var unosNizaB = Console.ReadLine();
            var vrednostiNizaB = unosNizaB.Split(" ");
            for (int i = 0; i < B.Length; i++)
            {
                B[i] = int.Parse(vrednostiNizaB[i]);
            }

            int indexMediane =N / 2;
            int mediane = A[indexMediane];

            for (int i = 0; i < Q; i++)
            {
                Console.WriteLine(namestiGlasanje(A,indexMediane, B[i],mediane));
            }

            Console.ReadLine();
        }
    }
}