using System;
using System.Diagnostics;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Xml.Schema;
class HelloWorld
{
    static void Main()
    {
        int n, q;
        var s1 = Console.ReadLine().Split();
        n = int.Parse(s1[0]);
        q = int.Parse(s1[1]);
        int i, j, h;
        bool k;
        List<int> a = new List<int>();
        int[] b = new int[q];
        var x = Console.ReadLine().Split();
        for(i=0; i<n; i++)
        {
            a.Add(int.Parse(x[i]));
        }
        a.Sort();
        x = Console.ReadLine().Split();
        for(i=0; i<q; i++)
        {
            b[i] = int.Parse(x[i]);
        }

        for(i=0; i<q; i++)
        {
            if(b[i] == a[n/2])
            {
                Console.WriteLine(0);
            }
            else
            {
                k = a.Exists(element => element == b[i]);
                if(k)
                {
                    a.Add(a[n-1]);
                    int brojac = 1;
                    while(a[a.Count/2] != b[i])
                    {
                        a.Add(a[n-1]);
                        brojac++;
                    }
                    Console.WriteLine(brojac);
                }
                else
                {
                    if(b[i] < a[n-1])
                    {
                        a.Add(b[i]);
                        a.Sort();
                        int brojac = 1;
                        while(a[a.Count/2] != b[i])
                        {
                            a.Add(a[a.Count-1]);
                            brojac++;
                        }
                        Console.WriteLine(brojac);
                    }
                    else Console.WriteLine(n);
                }
            }
        }
    }
}