using System;
using System.Linq;

namespace ConsoleApp23
{
    internal class Program
    {
        private static int median(int[] a)
        {
            Array.Sort(a);
            int x = a.Length / 2;
            return a[x];
        }

        static void Main(string[] args)
        {
            
            string bemenet = Console.ReadLine();
            string[] adatok = bemenet.Split(' ').ToArray();
            int n = Convert.ToInt32(adatok[0]);
            int q = Convert.ToInt32(adatok[1]);
            bemenet = Console.ReadLine();
            adatok = bemenet.Split(' ').ToArray();
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = Convert.ToInt32(adatok[i]);
            }
            bemenet = Console.ReadLine();
            adatok = bemenet.Split(' ').ToArray();
            int[] b = new int[q];
            for (int i = 0; i < q; i++)
            {
                b[i] = Convert.ToInt32(adatok[i]);
            }

            for (int i = 0; i < q; i++)
            {
                int c = 0;
                int med = median(a);
                if (med == b[i])
                {
                    Console.WriteLine(0);
                }
                else
                {
                    while (median(a) != b[i])
                    {
                        int num = a.Length;
                        Array.Resize(ref a, num+1);
                        a[num] = a[num - 1] + 1;
                        c++;
                    }
                    Array.Resize(ref a, n);
                    Console.WriteLine(c);
                }
            }

            //Console.ReadKey();
        }
    }
}