#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long qpow(long long a, long long p, long long mod) {
  long long res = 1;
  a %= mod;
  assert(p >= 0);
  for (; p; p >>= 1) {
    if (p & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
const int maxn = 5 + 1e5;
int n, k;
int a[maxn];
int l[20][maxn], h[20][maxn];
void RMQ() {
  for (int i = (1); i <= (n); i++) l[0][i] = h[0][i] = a[i];
  for (int i = (1); i <= ((int)log2(n)); i++) {
    int d = 1 << (i - 1);
    for (int j = (1); j <= (n - i + 1); j++) {
      h[i][j] = max(h[i - 1][j], h[i - 1][min(j + d, n)]);
      l[i][j] = min(l[i - 1][j], l[i - 1][min(j + d, n)]);
    }
  }
}
int p = -1;
bool check(int x) {
  for (int i = (1); i <= (n - x + 1); i++) {
    int L = i, R = i + x - 1;
    int len = (int)log2(R - L + 1);
    int dd = 1 << len;
    int x1 = h[len][L], x2 = h[len][R - dd + 1];
    int y1 = l[len][L], y2 = l[len][R - dd + 1];
    if (max(x1, x2) - min(y1, y2) <= k) {
      p = i;
      return true;
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = (1); i <= (n); i++) cin >> a[i];
  RMQ();
  int ans = 0;
  int q = 1, p = n;
  while (q <= p) {
    int mid = (q + p) >> 1;
    if (check(mid)) {
      ans = mid;
      q = mid + 1;
    } else
      p = mid - 1;
  }
  vector<pair<int, int> > res;
  for (int i = (1); i <= (n - ans + 1); i++) {
    int L = i, R = i + ans - 1;
    int len = (int)log2(R - L + 1);
    int dd = 1 << len;
    int x1 = h[len][L], x2 = h[len][R - dd + 1];
    int y1 = l[len][L], y2 = l[len][R - dd + 1];
    if (max(x1, x2) - min(y1, y2) <= k) res.push_back(make_pair(L, R));
  }
  cout << ans << ' ' << res.size() << endl;
  for (int i = (0); i < (res.size()); i++)
    cout << res[i].first << ' ' << res[i].second << endl;
}
