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

class Program
{

    public static void Main()
    {
        int n, q;
        string[] s = Console.ReadLine().Split();
        n = int.Parse(s[0]);
        q = int.Parse(s[1]);

        List<int> a = new List<int>();

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

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


        List<int> rezultat = new List<int>();
        foreach (int i in b)
        {
            List<int> ints = new List<int>(a);
            ints.Sort();
            int l = ints[ints.Count / 2];
            int brpok = 0;
            if (l == i)
            {
                rezultat.Add(brpok);
            }

            else
            {
                while (true)
                {
                    ints.Add(i);
                    ints.Sort();
                    l = ints[ints.Count / 2];
                    brpok++;
                    if (l == i)
                    {
                        rezultat.Add(brpok);
                        break;
                    }
                }
            }

        }

        foreach (int x in rezultat)
        {
            Console.WriteLine(x);
        }

    }

}