#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#pragma GCC target("avx2,popcnt")
using namespace std;
signed main() {
// freopen("in.txt", "r", stdin);
cin.tie(0)->sync_with_stdio(0);
int g;
cin >> g;
int n, q;
cin >> n >> q;
vector<int> a(n);
for (auto &it : a) cin >> it;
while (q--) {
int l, x;
cin >> l >> x;
--l;
vector<int> ans;
bitset<5010> cur;
cur.set();
cur[0] = 0;
for (int i = l; i < n; ++i) {
cur[a[i]] = 0;
if ((int)cur._Find_first() == i - l + 1 + 1 && i - l + 1 >= x) {
ans.push_back(i - l + 1);
}
}
if (ans.empty()) {
cout << "-1 0\n";
continue;
}
cout << ans[0] << ' ' << ans.size() << '\n';
}
}
I3ByYWdtYSBHQ0Mgb3B0aW1pemUoIk9mYXN0LHVucm9sbC1sb29wcyIpCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgojcHJhZ21hIEdDQyB0YXJnZXQoImF2eDIscG9wY250IikKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzaWduZWQgbWFpbigpIHsKICAvLyBmcmVvcGVuKCJpbi50eHQiLCAiciIsIHN0ZGluKTsKICBjaW4udGllKDApLT5zeW5jX3dpdGhfc3RkaW8oMCk7CiAgaW50IGc7CiAgY2luID4+IGc7CiAgaW50IG4sIHE7CiAgY2luID4+IG4gPj4gcTsKICB2ZWN0b3I8aW50PiBhKG4pOwogIGZvciAoYXV0byAmaXQgOiBhKSBjaW4gPj4gaXQ7CiAgd2hpbGUgKHEtLSkgewogICAgaW50IGwsIHg7CiAgICBjaW4gPj4gbCA+PiB4OwogICAgLS1sOwogICAgdmVjdG9yPGludD4gYW5zOwogICAgYml0c2V0PDUwMTA+IGN1cjsKICAgIGN1ci5zZXQoKTsKICAgIGN1clswXSA9IDA7CiAgICBmb3IgKGludCBpID0gbDsgaSA8IG47ICsraSkgewogICAgICBjdXJbYVtpXV0gPSAwOwogICAgICBpZiAoKGludCljdXIuX0ZpbmRfZmlyc3QoKSA9PSBpIC0gbCArIDEgKyAxICYmIGkgLSBsICsgMSA+PSB4KSB7CiAgICAgICAgYW5zLnB1c2hfYmFjayhpIC0gbCArIDEpOwogICAgICB9CiAgICB9CiAgICBpZiAoYW5zLmVtcHR5KCkpIHsKICAgICAgY291dCA8PCAiLTEgMFxuIjsKICAgICAgY29udGludWU7CiAgICB9CiAgICBjb3V0IDw8IGFuc1swXSA8PCAnICcgPDwgYW5zLnNpemUoKSA8PCAnXG4nOwogIH0KfQ==