#include <bits/stdc++.h>
using namespace std;
int n, K, h[100007], wMax[2 * (1 << 17)], wMin[2 * (1 << 17)];
vector<pair<int, int> > ans;
void BuildTree() {
  for (int i = 1; i <= (n); ++i)
    wMax[(1 << 17) + i] = wMin[(1 << 17) + i] = h[i];
  for (int i = (1 << 17); i >= 1; --i)
    wMax[i] = max(wMax[2 * i], wMax[2 * i + 1]),
    wMin[i] = min(wMin[2 * i], wMin[2 * i + 1]);
}
int QueryMax(int a, int b) {
  a += (1 << 17);
  b += (1 << 17);
  int rst = wMax[a];
  if (a != b) rst = max(rst, wMax[b]);
  while (a / 2 != b / 2) {
    if (!(a & 1)) rst = max(rst, wMax[a + 1]);
    if (b & 1) rst = max(rst, wMax[b - 1]);
    a /= 2;
    b /= 2;
  }
  return rst;
}
int QueryMin(int a, int b) {
  a += (1 << 17);
  b += (1 << 17);
  int rst = wMin[a];
  if (a != b) rst = min(rst, wMin[b]);
  while (a / 2 != b / 2) {
    if (!(a & 1)) rst = min(rst, wMin[a + 1]);
    if (b & 1) rst = min(rst, wMin[b - 1]);
    a /= 2;
    b /= 2;
  }
  return rst;
}
void pointers() {
  int j = 1, len = 1, mx = h[1], mn = h[1];
  for (int i = 1; i <= n; ++i) {
    while (j < i) ++j;
    mx = QueryMax(i, j);
    mn = QueryMin(i, j);
    while (j < n) {
      if (max(mx, h[j + 1]) - min(mn, h[j + 1]) > K) break;
      ++j;
      mx = max(mx, h[j]);
      mn = min(mn, h[j]);
      len = max(len, j - i + 1);
    }
    if (mx - mn <= K) len = max(len, j - i + 1);
  }
  for (int i = 1; i <= n - len + 1; ++i) {
    int mx = QueryMax(i, i + len - 1);
    int mn = QueryMin(i, i + len - 1);
    if (mx - mn <= K) ans.emplace_back(i, i + len - 1);
  }
  cout << len << " " << ((int)(ans).size());
  cout << '\n';
  for (auto j : ans) cout << j.first << " " << j.second, cout << '\n';
}
void solve() {
  cin >> n >> K;
  for (int i = 1; i <= (n); ++i) cin >> h[i];
  BuildTree();
  pointers();
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  solve();
  return 0;
}
