#include <bits/stdc++.h>
using namespace std;
int getmn(int mn[], int l, int h, int sl, int sh, int x) {
  if (l > sh || h < sl) return 1e9;
  if (l <= sl && sh <= h) return mn[x];
  int m = (sl + sh) / 2;
  int left = getmn(mn, l, h, sl, m, 2 * x);
  int right = getmn(mn, l, h, m + 1, sh, 2 * x + 1);
  if (left > right) return right;
  return left;
}
int getmx(int mx[], int l, int h, int sl, int sh, int x) {
  if (l > sh || h < sl) return 0;
  if (l <= sl && sh <= h) return mx[x];
  int m = (sl + sh) / 2;
  int left = getmx(mx, l, h, sl, m, 2 * x);
  int right = getmx(mx, l, h, m + 1, sh, 2 * x + 1);
  if (left < right) return right;
  return left;
}
void build(int mx[], int mn[], int a[], int l, int h, int ind) {
  if (l == h) {
    mx[ind] = a[l];
    mn[ind] = a[l];
    return;
  }
  int m = (l + h) / 2;
  build(mx, mn, a, l, m, 2 * ind);
  build(mx, mn, a, m + 1, h, 2 * ind + 1);
  if (mx[2 * ind] > mx[2 * ind + 1])
    mx[ind] = mx[2 * ind];
  else
    mx[ind] = mx[2 * ind + 1];
  if (mn[2 * ind] < mn[2 * ind + 1])
    mn[ind] = mn[2 * ind];
  else
    mn[ind] = mn[2 * ind + 1];
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, i, l, h, m, x, y, maxi;
  cin >> n >> k;
  int a[n], ans[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ans[i] = i;
  }
  int mx[4 * n], mn[4 * n];
  for (i = 0; i < 4 * n; i++) {
    mx[i] = 0;
    mn[i] = 0;
  }
  build(mx, mn, a, 0, n - 1, 1);
  for (i = 0; i < n; i++) {
    l = i;
    h = n;
    while (h > l + 1) {
      m = (l + h) / 2;
      x = getmx(mx, i, m, 0, n - 1, 1);
      y = getmn(mn, i, m, 0, n - 1, 1);
      if (x - y > k)
        h = m;
      else
        l = m;
    }
    ans[i] = l - i;
  }
  for (i = 0, maxi = 0; i < n; i++) {
    if (ans[i] > maxi) maxi = ans[i];
  }
  vector<pair<int, int>> v;
  for (i = 0; i < n; i++) {
    if (ans[i] == maxi) v.push_back({i, i + maxi});
  }
  cout << maxi + 1 << " " << v.size() << '\n';
  for (i = 0; i < v.size(); i++)
    cout << v[i].first + 1 << " " << v[i].second + 1 << '\n';
}
