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

namespace Takmicenje_2___2__Namestanje_glasanja_
{
    class Program
    {
        static int Scenario(int medijana, int[] a)
        {
            Array.Sort(a);
            int priv = 0;
            int index = Array.BinarySearch(a, medijana);
            if(index < 0)
            {
                index = ~index;
                priv = 1;
            }
            if (2 * index - a.Length + 1 - priv < 0) return (priv + a.Length - 2 * index - 1);
            else if (2 * index - a.Length + 1 - priv > 1)
                return (2 * index - a.Length);
            return priv;
        }
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split();
            int[] A = new int[Int32.Parse(ulaz[0])];
            int[] B = new int[Int32.Parse(ulaz[1])];
            ulaz = Console.ReadLine().Split();
            for (int i = 0; i < A.Length; i++)
                A[i] = Int32.Parse(ulaz[i]);
            ulaz = Console.ReadLine().Split();
            for (int i = 0; i < B.Length; i++)
                B[i] = Int32.Parse(ulaz[i]);
            for(int i = 0; i < B.Length; i++)
            {
                Console.WriteLine(Scenario(B[i], A));
            }
        }
    }
}