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

namespace tak._2
{
    class Program
    {
        static int Medijana(int[] niz)
        {
            return niz[niz.Length / 2];
        }
        static void Main(string[] args)
        {
            string[] pom = Console.ReadLine().Split();
            int n = int.Parse(pom[0]);
            int q = int.Parse(pom[1]);
            int[] a = new int [n];
            int[] b = new int [q];
            pom = Console.ReadLine().Split();
            for (int i = 0; i < a.Length; i++)
                a[i] = int.Parse(pom[i]);
            pom = Console.ReadLine().Split();
            for (int i = 0; i < b.Length; i++)
                b[i] = int.Parse(pom[i]);
            Array.Sort(a);
            int medijana;
            int br;
            for (int i = 0; i < b.Length; i++)
            {
                br = 0;
                medijana = Medijana(a);
                int[] aPom = a;
                while (b[i] != medijana)
                {
                    Array.Resize(ref aPom, aPom.Length + 1);
                    aPom[aPom.Length - 1] = b[i];
                    Array.Sort(aPom);
                    medijana = Medijana(aPom);
                    br++;
                }
                Console.WriteLine(br);

            }
        }
    }
}