import java.util.Arrays;
import java.util.Scanner;
 
class GFG
{
 

static int minNumber(int a[], int n, int x)
{
    
    Arrays.sort(a);
 
    int k;
    for (k = 0; a[(n) / 2] != x; k++)
    {
        a[n++] = x;
        Arrays.sort(a);
    }
    return k;
}
 

public static void main(String[] args)
{
    Scanner Input=new Scanner(System.in);
    int n=Input.nextInt();
    int q=Input.nextInt();
    int []niz_n=new int[n];
    int []niz_q=new int[q];
    for(int i=0;i<n;i++){
        niz_n[i]=Input.nextInt();
    }
    for(int i=0;i<q;i++){
        niz_q[i]=Input.nextInt();
    }
    for(int i=0;i<q;i++){
        System.out.println(minNumber(niz_n,n-1,niz_q[i]));
    }
    
    
}
}