用的二分
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read(){int x=0;char f=1,ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9')x=x10+ch-'0',ch=getchar();return xf;}
const int N=2e5+10;
struct node{
int num,id;
friend bool operator<(const node cmp_x,const node cmp_y){
if(cmp_x.num!=cmp_y.num)
return cmp_x.num<cmp_y.num;
return cmp_x.id<cmp_y.id;
}
}a[N];
bool operator<(const node cmp_x,int cmp_y){
return cmp_x.num<cmp_y;
}
signed main(){
int n=read(),m=read();
for(int i=1;i<=n;++i)
a[i]={read(),i};
sort(a+1,a+n+1);
for(int i=1;i<=m;++i){
int x=read();
int ans=lower_bound(a+1,a+n+1,x)-a;
printf("%lld\n",ans);
}
return 0;
}