#include <bits/stdc++.h>
using namespace std;
int q[100005];
int n, m;
int x[100005], y[100005], cnt;
struct node {
  int v, id;
} e;
int main() {
  int i, j;
  deque<node> q1, q2;
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> q[i];
  int cur = 1;
  int mx = 0;
  cnt = 0;
  for (i = 1; i <= n; i++) {
    e.v = q[i], e.id = i;
    while (!q1.empty() && q1.back().v < e.v) q1.pop_back();
    q1.push_back(e);
    while (!q2.empty() && q2.back().v > e.v) q2.pop_back();
    q2.push_back(e);
    while (q1.front().v - q2.front().v > m) {
      if (q1.front().id < q2.front().id) {
        cur = q1.front().id + 1;
        q1.pop_front();
      } else {
        cur = q2.front().id + 1;
        q2.pop_front();
      }
    }
    if (i - cur + 1 > mx) {
      mx = i - cur + 1;
      cnt = 0;
      x[cnt] = cur, y[cnt] = i;
      cnt++;
    } else if (i - cur + 1 == mx) {
      x[cnt] = cur, y[cnt] = i;
      cnt++;
    }
  }
  cout << mx << " " << cnt << endl;
  for (i = 0; i < cnt; i++) cout << x[i] << " " << y[i] << endl;
  return 0;
}
