#include <bits/stdc++.h>
using namespace std;
const int M = 1000000 + 10;
const int INF = int(1e9);
int n, k;
int a[M / 2], d[M];
int best = 1, l = 0, r = 0;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    d[a[i]] = 0;
  }
  d[a[0]]++;
  int diff = 1;
  int l1 = 0, r1 = 0;
  a[n] = a[n - 1];
  while (r1 < n) {
    r1++;
    if (d[a[r1]])
      d[a[r1]]++;
    else {
      diff++;
      d[a[r1]]++;
    }
    if (diff <= k) {
      if (best < r1 - l1 + 1) {
        best = r1 - l1 + 1;
        l = l1;
        r = r1;
        if (r1 == n) best--, r--;
      }
    } else {
      while (diff > k && l1 < r1) {
        if (d[a[l1]] == 1) diff--;
        d[a[l1]]--;
        l1++;
      }
    }
  }
  printf("%d %d\n", l + 1, r + 1);
  return 0;
}
