#include <iostream>
#include <algorithm>
#include  <string>
#include <vector>
using namespace std;
int main()
{
    int N,Q;
    cin >> N >> Q;
    vector<int>Array(N);
    int Nums[Q];
    for(int i=0;i<N;i++){cin >> Array[i];}
    for(int i=0;i<Q;i++){cin >> Nums[i];}
    sort(Array.begin(),Array.end());
    int position;
    for(int i=0;i<Q;i++){
    position = lower_bound(Array.begin(),Array.end(),Nums[i]) - Array.begin();
    position = abs(position - N/2);
    if(position!=0){
    if(N%2==0){
        position *= 2;
    }
    if(N%2==1){
        position = (position-1)*2 + 1;
    }}
    cout << position << endl;
    }
}