#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int i=0, R;
    unsigned int N,Q;
    cin >> N >> Q;
    long long int A[N], B[Q];
    for(i=0;i<N;i++) cin >> A[i];
    for(i=0;i<Q;i++) cin >> B[i];
    unsigned int M = A[N/2];

    for(i=0;i<Q;i++){
        R=0;
        int n=N;
        if(B[i]-M>0){
           while(B[i]-M>0){
            if(n%2==1)
                M = n/2+1>=N?B[i]:A[n/2+1];
            n++; R++;
            }
        }
        else{
            while(B[i]-M<0){
            if(n%2==1)
                M = n/2-1>=N?B[i]:A[n/2-1];
            n++; R++;
            }
        }
        cout << R << endl;
    }

    return 0;
}