using System;
using System.Collections.Generic;

class Program
{
    static int question(int x, List<int> A)
    {
        int ans = 0;
        if (A[A.Count / 2] == x) return 0;
        else if (A[A.Count / 2] < x) ans--;

        int ind = A.BinarySearch(x);
        if(ind < 0)
        {
            A.Add(x);
            A.Sort();
            ans++;
            ind = A.BinarySearch(x);
        }
        int a = ind;
        int b = A.Count - a - 1;
        //Console.WriteLine("A:" + a + "B: " + b + " ans: " + ans);
        ans += Math.Abs(a - b);
        return ans;
    }
    static void Main(string[] args)
    {
        string[] ulazNQ = Console.ReadLine().Split(' ');
        int n = Convert.ToInt32(ulazNQ[0]);
        int q = Convert.ToInt32(ulazNQ[1]);
        string[] ulazA = Console.ReadLine().Split(' ');
        List<int> A = new List<int>(n);
        for (int i = 0; i < ulazA.Length; i++)
            A.Add(Convert.ToInt32(ulazA[i]));
        A.Sort();
        int[] res = new int[q];
        string[] ulazQ = Console.ReadLine().Split(' ');
        for (int i = 0; i < ulazQ.Length; i++)
            res[i] = question(Convert.ToInt32(ulazQ[i]), new List<int>(A));
        for (int i = 0; i < q; i++)
            Console.WriteLine(res[i]);
    }
}