using System;
using System.Collections.Generic;
using System.Linq;

namespace _2___Namestanje_glasanja
{
    class Program
    {
        static void Main()
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int q = int.Parse(s[1]);

            List<int> a = new List<int>(n);
            s = Console.ReadLine().Split();
            for (int i = 0; i < n; i++)
                a.Add(int.Parse(s[i]));
            a.Sort();

            List<int> b = new List<int>(q);
            s = Console.ReadLine().Split();
            for (int i = 0; i < q; i++)
                b.Add(int.Parse(s[i]));

            int medijana = a[a.Count / 2];

            for (int i = 0; i < q; i++)
            {
                List<int> aPom = new List<int>(a);
                int br = 0;

                while (aPom[aPom.Count / 2] != b[i])
                {
                    aPom.Add(b[i]);
                    aPom.Sort();
                    br++;
                }

                Console.WriteLine(br);
            }
        }
    }
}