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

namespace Petlja_takmicenje_zad_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string unos;
            unos = Console.ReadLine();
            int n, q;
            string[] pom = unos.Split(' ');
            n = Convert.ToInt32(pom[0]);
            q = Convert.ToInt32(pom[1]);
            unos = Console.ReadLine();
            pom = unos.Split(' ');
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = Convert.ToInt32(pom[i]);
            }
            unos = Console.ReadLine();
            pom = unos.Split(' ');
            int[] b = new int[q];
            for (int i = 0; i < q; i++)
            {
                b[i] = Convert.ToInt32(pom[i]);
            }
            Array.Sort(a);
            List<int> aList = a.ToList();
            int[] br = new int[q];
            for (int i = 0; i < q; i++)
            {
                br[i] = 0;
            }
            for (int i = 0; i < q; i++)
            {
                while (a[n / 2] != b[i])
                {
                    br[i]++;
                    aList = a.ToList();
                    aList.Add(b[i]);
                    n++;
                    a = aList.ToArray();
                    Array.Sort(a);
                }
            }
            for (int i = 0; i < q; i++)
            {
                Console.WriteLine(br[i]);
            }

            Console.ReadLine();

        }
    }
}