include[HTML_REMOVED]
define N 100010
using namespace std;
int main() {
int n, q, a[N], k;
scanf(“%d %d”, &n, &q);
for (int i = 0; i < n; i++) {
scanf(“%d”, &a[i]);
}
while (q–) {
scanf(“%d”, &k);
int c;
int l = 0, r = n - 1, l1 = 0, r1 = n - 1;
while (l < r) {
int mid = (r + l + 1) / 2;
if (a[mid] <= k) l = mid;
else r = mid - 1;
}
while (l1 < r1) {
int mid1 = (r1 + l1) / 2;
if (a[mid1] >= k) r1=mid1;
else l1=mid1+1;
}
if (a[l] != k) printf(“-1 -1\n”);
else printf(“%d %d\n”, l1, l);
}
return 0;
}