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

namespace ConsoleApp3
{
    internal class Program
    {
        public static void menjaj(int[] niz,int i,int j)
        {
            int t = niz[i];
            niz[i] = niz[j];
            niz[j] = t;
        }

        private static int podela(int[] niz,int l,int d)
        {
            int index = l;
            int pivot = niz[l];

            for(int i=l+1 ; i<= d ; i++)
            {
                if (niz[i] < pivot)
                {
                    index++;
                    menjaj(niz,index,i);
                }
            }
            menjaj(niz, index, l);
            return index;
        }

        private static void BrziSort(int[] niz, int l,int d)
        {
            if (l<d)
            {
                var pi = podela(niz, l, d);
                BrziSort(niz,l,pi-1);
                BrziSort(niz, pi+1, d);
            }
        }

        static void Main(string[] args)
        {
            string u = Console.ReadLine();
            string[] ulaz = new string[2];
            ulaz = u.Split(' ');

            int n =Convert.ToInt32(ulaz[0]);
            int q = Convert.ToInt32(ulaz[1]);

            u = Console.ReadLine();
            ulaz = new string[n];
            int[] a = new int[n];
            ulaz = u.Split(' ');
            for(int i=0; i<n; i++)
            {
                a[i] = Convert.ToInt32(ulaz[i]);
            }

            u = Console.ReadLine();
            ulaz = new string[q];
            int[] b = new int[q];
            ulaz = u.Split(' ');
            for (int i = 0; i < q; i++)
            {
                b[i] = Convert.ToInt32(ulaz[i]);
            }

            BrziSort(a,0,a.Length-1);

            int medijan = a[(n/2)];
            for(int i=0; i<q; i++)
            {
                int brV = 0, brM = 0,brJ=0;
                for(int j=0; j<n; j++)
                {
                    if (b[i] < a[j])
                    {
                        brV++;
                    }
                    else if (b[i]==a[j])
                    {
                        brJ++;
                    }
                    else
                    {
                        brM++;
                    }
                }
                if (medijan == b[i])
                {
                    Console.WriteLine(0);
                }
                else if(medijan > b[i])
                {
                    Console.WriteLine(brV-brM);
                }
                else if(medijan < b[i])
                {
                    Console.WriteLine(brM-brV-brJ);
                }
            }

            Console.ReadLine();
        }
    }
}