Beaut1ful @ 2024-03-05 20:02:52
n,m = map(int,input().split())
ls_num = input().split()
ls_Q = input().split()
for i in ls_Q:
if i not in ls_num:
print(-1,end=" ")
continue
lf = -1
rt = n
while lf+1 != rt:
mid = (lf+rt)//2
if int(ls_num[mid]) < int(i):
lf = mid
else:
rt = mid
else:
if ls_num[lf] == i:
print(lf,end=" ")
elif ls_num[rt] == i:
print(rt+1,end=" ")