#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double pi = acos(-1.0);
const double eps = 1e-9;
int a[2000100], n, w[2000100], cnt, l, k, res;
void add(int x) {
  w[x]++;
  if (w[x] == 1) cnt++;
}
void del(int x) {
  w[x]--;
  if (w[x] == 0) cnt--;
}
int resi = 0;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  l = 1;
  for (int i = 1; i <= n; i++) {
    add(a[i]);
    while (cnt > k) {
      del(a[l]);
      l++;
    }
    res = max(res, i - l + 1);
    if (res == i - l + 1) {
      resi = l;
    }
  }
  cout << resi << " " << resi + res - 1;
  return 0;
}
