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

namespace ConsoleApp6
{
    internal class Program
    {
        static int broj_glasova_dodat(int a, int[] N) {
            List<int> N1 = new List<int>();
            int glasovi = 0;
            for (int k = 0; k < N.Length; k++){
                N1.Add(N[k]);
            }
            if (N.Contains(a) == false) { N1.Add(a); }
            int i = 0;
            if (a > N1[N1.Count / 2]) {
                while (N1[i] < a) {
                    i++;
                }
            }
            else if (a < N1[N1.Count / 2])
            {
                while (N1[i] > a)
                {
                    i++;
                }
            }
            glasovi = i * 2 - N.Length;
            return glasovi;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int N = int.Parse(s[0]);
            int Q = int.Parse(s[1]);
            int[] A = new int[N];
            int[] B = new int[Q];
            int[] C = new int[Q];
            int c = 0;
            s = Console.ReadLine().Split();
            for (int i = 0; i < N; i++)
            {
                A[i] = Convert.ToInt32(s[i]);
            }
            s = Console.ReadLine().Split();
            for (int i = 0; i < Q; i++)
            {
                B[i] = Convert.ToInt32(s[i]);
            }
            Array.Sort(A);
            for (int i = 0; i < Q; i++) {
                c = 0;
                if (A[(N / 2)] != B[i])
                {
                    c = broj_glasova_dodat(B[i], A);
                }
                C[i] = c;
            }
            for (int i = 0; i < C.Length; i++) {
                Console.WriteLine(C[i]);
            }
            Console.ReadLine();

        }
    }
}