#include <bits/stdc++.h>
using namespace std;
struct RMQ {
  int size;
  int (*comp)(int, int);
  vector<int> range;
  static int Min(int a, int b) { return !(b < a) ? a : b; }
  static int Max(int a, int b) { return (a < b) ? b : a; }
  RMQ(const vector<int>& array, int (*comp)(int, int) = Min) {
    size = array.size();
    this->comp = comp;
    range.resize(4 * size);
    init(array, 0, size - 1, 1);
  }
  int init(const vector<int>& array, int left, int right, int node) {
    if (left == right) return range[node] = array[left];
    int mid = (left + right) / 2;
    int l = init(array, left, mid, node * 2);
    int r = init(array, mid + 1, right, node * 2 + 1);
    return range[node] = comp(l, r);
  }
  int query(int left, int right, int node, int nodeLeft, int nodeRight) {
    if (right < nodeLeft || nodeRight < left)
      return (comp == Min) ? numeric_limits<int>::max()
                           : numeric_limits<int>::min();
    if (left <= nodeLeft && nodeRight <= right) return range[node];
    int mid = (nodeLeft + nodeRight) / 2;
    int l = query(left, right, node * 2, nodeLeft, mid);
    int r = query(left, right, node * 2 + 1, mid + 1, nodeRight);
    return comp(l, r);
  }
  int query(int left, int right) { return query(left, right, 1, 0, size - 1); }
};
int N, K;
vector<int> H;
int correspond[(int)1e6];
void init() {
  scanf("%d %d", &N, &K);
  for (int i = 0; i < N; ++i) {
    int h;
    scanf("%d", &h);
    H.push_back(h);
  }
}
void solve() {
  RMQ rminq = RMQ(H);
  RMQ rmaxq = RMQ(H, RMQ::Max);
  int ret = 0;
  int from = 0, to = 0;
  int maxH = 0, minH = 987654321;
  for (int i = 0; i < N; ++i) {
    int h = H[i];
    to = i;
    maxH = rmaxq.query(from, to);
    minH = rminq.query(from, to);
    while (maxH - minH > K) {
      ++from;
      if (h == maxH)
        minH = rminq.query(from, to);
      else
        maxH = rmaxq.query(from, to);
    }
    int len = to - from + 1;
    if (ret <= len) {
      ret = len;
      correspond[from] = to;
    }
  }
  vector<pair<int, int>> period;
  for (int i = 0; i < (int)1e6; ++i) {
    if (correspond[i] - i == ret - 1) period.push_back({i, correspond[i]});
  }
  printf("%d %d\n", ret, period.size());
  for (int i = 0; i < period.size(); ++i)
    printf("%d %d\n", period[i].first + 1, period[i].second + 1);
}
int main() {
  int C = 1;
  while (C--) {
    init();
    solve();
  }
  return 0;
}
