#include <iostream>
#include <algorithm>
#include  <string>
#include <vector>
using namespace std;
int main()
{
    long long N,Q;
    cin >> N >> Q;
    vector<long long>Array(N);
    long long Nums[Q];
    for(long long i=0;i<N;i++){cin >> Array[i];}
    for(long long i=0;i<Q;i++){cin >> Nums[i];}
    sort(Array.begin(),Array.end());
    long long position;
    for(long long 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;
    }
}