#include <bits/stdc++.h>
using namespace std;
int n;
int k;
class myPair {
 public:
  int a, b;
  myPair() {}
  myPair(int x, int y) {
    a = x;
    b = y;
  }
};
class segment_tree {
 public:
  myPair tree[4 * 100010];
  int val[100010];
  int k;
  vector<myPair> sol;
  segment_tree(int n, int* r, int kk) {
    k = kk;
    for (int i = 0; i < n; i++) val[i] = r[i];
    build(1, 0, n - 1);
    search(n);
  }
  void build(int node, int a, int b) {
    if (a > b) return;
    if (a == b) {
      tree[node] = myPair(val[a], val[a]);
      return;
    }
    build(node * 2, a, (a + b) / 2);
    build(1 + node * 2, 1 + (a + b) / 2, b);
    tree[node] = myPair(min(tree[node * 2].a, tree[1 + node * 2].a),
                        max(tree[node * 2].b, tree[1 + node * 2].b));
  }
  myPair query(int node, int a, int b, int i, int j) {
    if (a > b || a > j || b < i) return myPair(1000000000, 0);
    if (a >= i && b <= j) return tree[node];
    myPair q1 = query(node * 2, a, (a + b) / 2, i, j);
    myPair q2 = query(1 + node * 2, 1 + (a + b) / 2, b, i, j);
    return myPair(min(q1.a, q2.a), max(q1.b, q2.b));
  }
  bool check(myPair ch) { return (abs(ch.b - ch.a) > k) ? false : true; }
  void search(int n) {
    bool found = false;
    int f = n;
    int l = 1, h = n;
    int i = 0, j = 0;
    int mx = 0;
    while (l <= h) {
      f = (l + h) / 2;
      i = 0;
      j = f - 1;
      while (j < n) {
        if (check(query(1, 0, n - 1, i, j))) {
          found = true;
          break;
        }
        i++;
        j++;
      }
      if (found) {
        found = false;
        mx = f;
        l = f + 1;
      } else {
        h = f - 1;
      }
    }
    i = 0;
    j = mx - 1;
    while (j < n) {
      if (check(query(1, 0, n - 1, i, j))) {
        sol.push_back(myPair(i, j));
      }
      i++;
      j++;
    }
  }
};
int main() {
  scanf("%d %d", &n, &k);
  int ar[100010];
  for (int i = 0; i < n; ++i) {
    scanf("%d", &ar[i]);
  }
  segment_tree* tree = new segment_tree(n, ar, k);
  vector<myPair> ans = tree->sol;
  int a = 0, b = 0;
  if (ans.size() > 0) {
    myPair f = ans[0];
    b = tree->sol.size();
    a = abs(f.b - f.a + 1);
  }
  printf("%d %d\n", a, b);
  for (int i = 0; i < (int)tree->sol.size(); i++) {
    myPair x = tree->sol[i];
    printf("%d %d\n", x.a + 1, x.b + 1);
  }
  return 0;
}
