#include <bits/stdc++.h>
using namespace std;
using L = long long;
using PII = pair<int, int>;
using PLL = pair<L, L>;
using VI = vector<int>;
using VL = vector<L>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using VPII = vector<PII>;
using VPLL = vector<PLL>;
using UMII = unordered_map<int, int>;
using UMLL = unordered_map<L, L>;
using USI = unordered_set<int>;
using USL = unordered_set<L>;
void SC(int &i) { scanf("%d", &i); }
void SC(int &i, int &j) { scanf("%d %d", &i, &j); }
void SC(int &i, int &j, int &k) { scanf("%d %d %d", &i, &j, &k); }
void SC(L &i) { scanf("%lld", &i); }
void SC(L &i, L &j) { scanf("%lld %lld", &i, &j); }
void SC(L &i, L &j, L &k) { scanf("%lld %lld %lld", &i, &j, &k); }
void print(VL arr, const string sep = " ", const string end = "\n") {
  for (L i = 0; i < ((int)arr.size()); ++i)
    printf("%lld%s", arr[i], sep.c_str());
  printf("%s", end.c_str());
}
void print(VI arr, const string sep = " ", const string end = "\n") {
  for (L i = 0; i < ((int)arr.size()); ++i) printf("%d%s", arr[i], sep.c_str());
  printf("%s", end.c_str());
}
const int INF = 1e9;
const int MOD = 1e9 + 7;
int main() {
  int n, k, left = 0;
  SC(n, k);
  VI h(n, 0);
  VPII ans;
  deque<PII> minstack, maxstack;
  for (int ni = 0; ni < n; ++ni) SC(h[ni]);
  int maxlen = INT_MIN;
  for (int ni = 0; ni < n; ++ni) {
    while (((int)minstack.size()) and minstack.back().first >= h[ni])
      minstack.pop_back();
    minstack.push_back(make_pair(h[ni], ni));
    while (((int)maxstack.size()) and maxstack.back().first <= h[ni])
      maxstack.pop_back();
    maxstack.push_back(make_pair(h[ni], ni));
    while (((int)minstack.size()) and ((int)maxstack.size()) and
           ((maxstack.front().first - minstack.front().first > k) or
            maxstack.front().second < left or minstack.front().second < left)) {
      ++left;
      while (((int)minstack.size()) and minstack.front().second < left)
        minstack.pop_front();
      while (((int)maxstack.size()) and maxstack.front().second < left)
        maxstack.pop_front();
    }
    int clen = ni - left + 1;
    if (clen > maxlen) {
      ans.clear();
      ans.push_back(make_pair(left, ni));
      maxlen = clen;
    } else if (clen == maxlen) {
      ans.push_back(make_pair(left, ni));
    }
  }
  if (not ans.size()) {
    print(VL{1, n});
    for (L ni = 0; ni < n; ++ni) {
      print(VL{ni + 1, ni + 1});
    }
    return 0;
  }
  print(VI{ans[0].second - ans[0].first + 1, ((int)ans.size())});
  for (auto [si, ei] : ans) {
    print(VI{si + 1, ei + 1});
  }
  return 0;
}
