#include <bits/stdc++.h>
using namespace std;
ifstream fi;
long long n, a[500000], mi[500000], ma[500000], d[500000], k, t, kq,
    kqq[500000], tt;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  mi[n] = n;
  ma[n] = n;
  for (int i = n - 1; i >= 0; i--) {
    long x = i + 1;
    if (a[i] < a[i + 1])
      mi[i] = x;
    else {
      while (a[i] > a[x] && x < n) x = mi[x];
      mi[i] = x;
    }
    x = i + 1;
    if (a[i] > a[i + 1])
      ma[i] = x;
    else {
      while (a[i] < a[x] && x < n) x = ma[x];
      ma[i] = x;
    }
  }
  long l = 0, r = 0;
  d[1] = 1;
  t = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] < a[l]) l = i;
    if (a[l] > a[t] || a[r] < a[t]) t = min(l, r);
    if (a[i] > a[r]) r = i;
    if (a[l] > a[t] || a[r] < a[t]) t = min(l, r);
    while (abs(a[l] - a[r]) > k) {
      if (l < r)
        l = mi[l];
      else
        r = ma[r];
      t = min(l, r);
    }
    if (a[l] > a[t] || a[r] < a[t]) t = min(l, r);
    if (abs(a[l] - a[r]) <= k) d[i] = i - t + 1;
    if (d[i] > i) d[i] = i;
    if (d[i - 1] >= kq && d[i - 1] >= d[i]) {
      long maa = 0, mii = 1e9;
      if (kq * tt > 500000) {
        mii = 0;
        maa = 0;
      } else
        for (int j = i - d[i - 1]; j <= i - 1; j++) {
          if (a[j] > maa) maa = a[j];
          if (a[j] < mii) mii = a[j];
        }
      if (maa - mii <= k)
        if (kq < d[i - 1]) {
          kq = d[i - 1];
          tt = 1, kqq[tt] = i - 1;
        } else {
          tt++;
          kqq[tt] = i - 1;
        }
    }
  }
  long i = n + 1;
  if (d[i - 1] >= kq && d[i - 1] >= d[i]) {
    long maa = 0, mii = 1e9;
    for (int j = i - d[i - 1]; j <= i - 1; j++) {
      if (a[j] > maa) maa = a[j];
      if (a[j] < mii) mii = a[j];
    }
    if (maa - mii <= k)
      if (kq < d[i - 1]) {
        kq = d[i - 1];
        tt = 1, kqq[tt] = i - 1;
      } else {
        tt++;
        kqq[tt] = i - 1;
      }
  }
  cout << kq << " " << tt << "\n";
  for (int i = 1; i <= tt; i++)
    cout << kqq[i] - d[kqq[i]] + 1 << " " << kqq[i] << "\n";
}
