using System;

  internal class Program
  {
    static void Main(string[] args)
    {
        string[] duzine = Console.ReadLine().Split(' ');
        int N = int.Parse(duzine[0]);
        int Q = int.Parse(duzine[1]);

        string[] a = Console.ReadLine().Split(' ');
        int[] A = new int[N];
        for (int i = 0; i < N; i++)
        {
            A[i] = int.Parse(a[i]);
        }

        string[] q = Console.ReadLine().Split(' ');
        int[] B = new int[Q];
        for (int j = 0; j < Q; j++)
        {
            B[j] = int.Parse(q[j]);
        }

        int[] minimalniglasovi = new int[Q];
        Array.Sort(A);
        int medijana = A[N / 2];

        for(int t = 0;t<Q;t++)
        {
            int provera= B[t];

            if (medijana >= provera) minimalniglasovi[t] = 0;
            else if (provera > A[N - 1]) minimalniglasovi[t] = N;
            else
            {
                for (int i = N / 2 + 1; i < N; i++)
                {
                    if (provera <= A[i])
                    {
                        minimalniglasovi[t] = 2*i-N;
                        break;
                    }

                }
            }
        }

        foreach(int el in minimalniglasovi)
        {
            Console.WriteLine(el);
        }

    }
  }