#include<stdio.h>#defineN100010int n, m, nums[N], x;// 左边界 mid 下取整voidleft(int x){int l =0, r = n -1;while(l < r){int mid = l + r >>1;if(nums[mid]< x) l = mid +1;else r = mid;}if(nums[l]!= x) l =-1;printf("%d ", l);}// 右边界 mid 上取整voidright(int x){int l =0, r = n -1;while(l < r){int mid = l + r +1>>1;if(nums[mid]> x) r = mid -1;else l = mid;}if(nums[r]!= x) r =-1;printf("%d\n", r);}intmain(){scanf("%d%d",&n,&m);for(int i =0; i < n; i++)scanf("%d",&nums[i]);for(int i =0; i < m; i++){scanf("%d",&x);left(x);right(x);}}