#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  if (0) return;
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  if (0) return;
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
inline void INP();
const long long N = 1e5 + 7, M = 1000000007, inf = INT_MAX;
const long long INF = LLONG_MAX;
long long n, Q;
long long arr[N + 2];
template <typename T>
class segment_tree {
 public:
  long long sz, lz = 0;
  vector<T> segt;
  vector<long long> lazy;
  void init(long long x) {
    lz = 0;
    sz = x;
    segt.resize(4 * sz);
  }
  T first(T a, T b) {
    pair<long long, long long> res;
    res.first = min(a.first, b.first);
    res.second = max(a.second, b.second);
    return res;
  }
  void push(long long i, long long l, long long r) {}
  T qry(long long l, long long r, long long i, long long L, long long R) {
    if (r < L or R < l) return {inf, -inf};
    if (L <= l and r <= R) return segt[i];
    long long mid = (l + r) / 2;
    T a = qry(l, mid, 2 * i + 1, L, R), b = qry(mid + 1, r, 2 * i + 2, L, R);
    if (lz) get(i);
    return first(a, b);
  }
  void upd(long long l, long long r, long long i, long long L, long long R,
           long long val) {
    if (l > R or L > r) return;
    if (L <= l and r <= R) {
      segt[i] = {val, val};
      return;
    }
    long long mid = (l + r) / 2;
    upd(l, mid, i * 2 + 1, L, R, val);
    upd(mid + 1, r, i * 2 + 2, L, R, val);
    get(i);
  }
  T query(long long L, long long R = -1) {
    if (R == -1) R = L;
    return qry(0, sz - 1, 0, L, R);
  }
  void update(long long val, long long L, long long R = -1) {
    if (R == -1) R = L;
    upd(0, sz - 1, 0, L, R, val);
  }
  void get(long long i) { segt[i] = first(segt[2 * i + 1], segt[2 * i + 2]); }
};
long long ans[N];
void solve() {
  long long n, h;
  cin >> n >> h;
  for (long long i = 0; i < (long long)n; i++) cin >> arr[i];
  segment_tree<pair<long long, long long> > sgt;
  sgt.init(n);
  for (long long i = 0; i < (long long)n; i++) sgt.update(arr[i], i);
  long long i = 0, j = 0, mn, mx, a = 1;
  while (i < n) {
    if (j != n) {
      pair<long long, long long> p = sgt.query(i, j);
      mn = p.first, mx = p.second;
    }
    while (j < n and abs(mn - mx) <= h) {
      j++;
      mn = min(mn, arr[j]);
      mx = max(mx, arr[j]);
    }
    ans[i] = j - i;
    a = max(a, ans[i]);
    i++;
  }
  long long cnt = 0;
  vector<long long> vec;
  for (long long i = 0; i < (long long)n; i++)
    if (ans[i] == a) vec.push_back(i + 1), cnt++;
  cout << a << " " << cnt << '\n';
  for (auto i : vec) {
    cout << i << " " << i + a - 1 << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  INP();
  long long test = 1;
  while (test--) solve();
}
inline void INP() {}
