"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => ({ key: +v }));
    var hmin = new Heap(n + 1);
    var hmax = new Heap(n + 1, (a, b) => b - a, 'idMax');
    hmin.push(h[0]);
    hmax.push(h[0]);
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (j >= n)
                break;
            hmin.push(h[j]);
            hmax.push(h[j]);
            if (hmax.h[0].key - hmin.h[0].key > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        hmin.pop(h[i].idMin);
        hmax.pop(h[i].idMax);
        i++;
        while ((hmax.size ? hmax.h[0].key - hmin.h[0].key : 0) > k) {
            hmin.pop(h[i].idMin);
            hmax.pop(h[i].idMax);
            i++;
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class Heap {
    constructor(MAX_LENGTH = 100000, comp = (a, b) => a - b, id = 'idMin') {
        this.h = Array(MAX_LENGTH);
        this.size = 0;
        this.comp = comp;
        this.id = id;
    }
    push(node) {
        this.h[this.size] = node;
        node[this.id] = this.size;
        this.size++;
        while (true) {
            if (node[this.id] == 0)
                break;
            var parentId = (node[this.id] - 1) >> 1;
            if (this.comp(this.h[parentId].key, node.key) > 0) {
                this.h[node[this.id]] = this.h[parentId];
                this.h[node[this.id]][this.id] = node[this.id];
                this.h[parentId] = node;
                node[this.id] = parentId;
            }
            else
                break;
        }
    }
    pop(id = 0) {
        var popNode = this.h[id];
        this.size--;
        this.h[id] = this.h[this.size];
        this.h[id][this.id] = id;
        var node = this.h[id];
        while (true) {
            var childId = node[this.id] * 2 + 1;
            if (childId >= this.size)
                break;
            if (childId < this.size - 1 && this.comp(this.h[childId].key, this.h[childId + 1].key) > 0)
                childId++;
            if (this.comp(this.h[childId].key, node.key) > 0)
                break;
            this.h[node[this.id]] = this.h[childId];
            this.h[node[this.id]][this.id] = node[this.id];
            this.h[childId] = node;
            node[this.id] = childId;
        }
        while (true) {
            if (node[this.id] == 0)
                break;
            var parentId = (node[this.id] - 1) >> 1;
            if (this.comp(this.h[parentId].key, node.key) > 0) {
                this.h[node[this.id]] = this.h[parentId];
                this.h[node[this.id]][this.id] = node[this.id];
                this.h[parentId] = node;
                node[this.id] = parentId;
            }
            else
                break;
        }
        popNode[this.id] = -1;
        return popNode;
    }
}

class Node {
  next; key;
  constructor(key, MAX_LAYER) {
    this.key = key;
    this.next = Array(MAX_LAYER);
  }
}

class SkipList {
  head; MAX_LAYER; maxNode;
  constructor(MAX_LAYER = 3) {
    this.MAX_LAYER = MAX_LAYER;
    this.head = new Node(-1e10, MAX_LAYER);
    for (let i = 0; i < MAX_LAYER; i++)this.head.next[i] = null;
  }

  insert(key) {
    var cur = this.head;
    var layer = this.MAX_LAYER - 1;
    var trace = [];
    while (layer >= 0) {
      while (cur.next[layer] && cur.next[layer].key < key) {
        cur = cur.next[layer];
      }
      if (trace[trace.length - 1] != cur) trace.push(cur);
      layer--;
    }
    var node = new Node(key);
    if (this.maxNode && this.maxNode.key < key) this.maxNode = node;
    node.next[0] = cur.next[0];
    cur.next[0] = node;
    for (let i = 1; i < this.MAX_LAYER; i++) {
      if (Math.random() < 0.5) break;
      while (cur.next[i] === undefined) {
        cur = trace.pop();
      }
      node.next[i] = cur.next[i];
      cur.next[i] = node;
    }
  }

  remove(key) {
    if (this.maxNode && this.maxNode.key == key) this.maxNode = undefined;
    var cur = this.head;
    var layer = this.MAX_LAYER - 1;
    var trace = [];
    while (layer >= 0) {
      while (cur.next[layer] && cur.next[layer].key < key) {
        cur = cur.next[layer];
      }
      if (trace[trace.length - 1] != cur) trace.push(cur);
      layer--;
    }
    var node = cur.next[0];
    if (!node || node.key != key) return;
    cur.next[0] = node.next[0];
    for (let i = 1; i < this.MAX_LAYER; i++) {
      if (node.next[i] === undefined) break;
      while (cur.next[i] != node) {
        cur = trace.pop();
      }
      cur.next[i] = node.next[i];
    }
  }

  min() {
    return (this.head.next[0] || {}).key;
  }

  max() {
    if (this.maxNode) return this.maxNode.key;
    var cur = this.head;
    for (let i = this.MAX_LAYER - 1; i >= 0; i--) {
      while (cur.next[i]) cur = cur.next[i];
    }
    if (cur != this.head) this.maxNode = cur;
    return cur != this.head ? cur.key : undefined;
  }

  print() {
    for (let i = 0; i < this.MAX_LAYER; i++) {
      let arr = [];
      let cur = this.head.next[i];
      while (cur) {
        arr.push(cur.key);
        cur = cur.next[i];
      }
      console.log(`Layer ${i}: ${arr.join(' ')}`)
    }
  }
}

// var t = Date.now();
// var sk = new SkipList(20);
// var arr = Array(1e5).fill(0).map(v => Math.random() * 1e9 | 0);
// arr.forEach(v => sk.insert(v));
// console.log(Date.now() - t);
// arr.forEach(v => sk.remove(v));
// console.log(Date.now() - t);

var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
  inputResolve();
});
(async () => {
  await inputPromise;
  var inputs = input.split(/\r?\n/);
  var [n, k] = inputs[0].split(' ').map(v => +v);
  var h = inputs[1].split(' ').map(v => +v);
  var sk = new SkipList(20);
  sk.insert(h[0]);
  var max = 1;
  var allRes = [];
  var i = 0, j = 0;
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      sk.insert(h[j]);
      if (sk.max() - sk.min() > k) break;
    }
    if (max < j - i) {
      max = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (max == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    sk.remove(h[i++]);
    while (sk.max() - sk.min() > k) {
      sk.remove(h[i++]);
    }
  }
  console.log(max, allRes.length);
  console.log(allRes.join('\n'));
})();

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var t = new BSTree();
    // h.forEach(v => t.insert(v));
    // console.log(Date.now() - time);
    // return;
    t.insert(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            t.insert(h[j]);
            // console.log(i, j, hk, t.print());
            if (t.key(j - i) - t.key(0) > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        // console.log(t.print(), i, j, h[i])
        t.remove(h[i++]);
        while (t.key(j - i) - t.key(0) > k) {
            // console.log('NOOO', i, j, h[i]);
            t.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - time)
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class BSNode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        var left = this.left;
        if (!left)
            return;
        this.left = left.right;
        left.right = this;
        this.update();
        left.update();
    }
    rotateLeft() {
        var right = this.right;
        if (!right)
            return;
        this.right = right.left;
        right.left = this;
        this.update();
        right.update();
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}
class BSTree {
    constructor(root) {
        this.root = root;
    }
    at(index) {
        var node = this.root;
        while (node) {
            var sizeLeft = node.left ? node.left.size : 0;
            if (sizeLeft == index)
                return node;
            if (index < sizeLeft)
                node = node.left;
            else {
                node = node.right;
                index -= sizeLeft + 1;
            }
        }
        return undefined;
    }
    key(index) {
        var _a;
        return ((_a = this.at(index)) === null || _a === void 0 ? void 0 : _a.key) || 0;
    }
    balance(node, parent) {
        var left = node.left;
        var right = node.right;
        var sizeLeft = left ? left.size : 0;
        var sizeRight = right ? right.size : 0;
        var sizeLeftLeft = left && left.left ? left.left.size : 0;
        var sizeLeftRight = left && left.right ? left.right.size : 0;
        var sizeRightLeft = right && right.left ? right.left.size : 0;
        var sizeRightRight = right && right.right ? right.right.size : 0;
        var dif = Math.abs(sizeLeft - sizeRight);
        if (Math.abs(1 + sizeRight + sizeLeftRight - sizeLeftLeft) < dif) {
            node.rotateRight();
            if (!parent)
                this.root = left;
            else {
                if (parent.left == node)
                    parent.left = left;
                else
                    parent.right = left;
            }
            return this.balance(left, parent);
        }
        else if (Math.abs(1 + sizeLeft + sizeRightLeft - sizeRightRight) < dif) {
            node.rotateLeft();
            if (!parent)
                this.root = right;
            else {
                if (parent.left == node)
                    parent.left = right;
                else
                    parent.right = right;
            }
            return this.balance(right, parent);
        }
        return node;
    }
    insert(key) {
        if (!this.root)
            return this.root = new BSNode(key);
        var parent = undefined;
        var node = this.root;
        while (true) {
            node = this.balance(node, parent);
            if (key < node.key) {
                node.size++;
                if (!node.left)
                    return node.left = new BSNode(key);
                parent = node;
                node = node.left;
            }
            else {
                node.size++;
                if (!node.right)
                    return node.right = new BSNode(key);
                parent = node;
                node = node.right;
            }
        }
    }
    join(tree) {
        if (!this.root)
            return this.root = tree.root;
        var node = this.root;
        var right = node.right;
        while (right) {
            node.rotateLeft();
            node = right;
            right = right.right;
        }
        node.right = tree.root;
        node.update();
        this.root = node;
        this.balance(this.root);
    }
    remove(key) {
        var parent = undefined;
        var node = this.root;
        while (node && node.key != key) {
            parent = node;
            node.size--;
            if (key < node.key)
                node = node.left;
            else
                node = node.right;
        }
        if (!node)
            return;
        var newTree = new BSTree(node.left);
        newTree.join(new BSTree(node.right));
        if (!parent)
            return this.root = newTree.root;
        if (parent.left == node)
            parent.left = newTree.root;
        else
            parent.right = newTree.root;
    }
    print() {
        console.log(this.root ? this.root.print() : undefined);
    }
}

class Node {
  left; right; key; min; max;
  constructor(key) {
    this.key = key;
    this.min = key;
    this.max = key;
  }
  update() {
    this.min = Math.min(this.key, this.left ? this.left.min : 1e10, this.right ? this.right.min : 1e10);
    this.max = Math.max(this.key, this.left ? this.left.max : -1e10, this.right ? this.right.max : -1e10);
  }
  // toString() {
  //   return (this.left ? this.left.toString() + ' ' : '') + `${this.key},${this.min},${this.max}` + (this.right ? ' ' + this.right.toString() : '')
  // }
}

class SplayTree {
  root;
  constructor(node) {
    this.root = node;
  }

  uptree(x, p, g) {
    if (!g) {
      if (p.left == x) {
        p.left = x.right;
        x.right = p;
      } else {
        p.right = x.left;
        x.left = p;
      }
      p.update(); x.update();
      return x;
    }
    if (g.left == p && p.left == x) {
      g.left = p.right;
      p.right = g;
      p.left = x.right;
      x.right = p;
    } else if (g.right == p && p.right == x) {
      g.right = p.left;
      p.left = g;
      p.right = x.left;
      x.left = p;
    } else if (g.left == p) {
      p.right = x.left;
      x.left = p;
      g.left = x.right;
      x.right = g;
    } else {
      p.left = x.right;
      x.right = p;
      g.right = x.left;
      x.left = g;
    }
    g.update(); p.update(); x.update();
    return x;
  }

  splay(trace) {
    var x = trace.pop();
    while (true) {
      var p = trace.pop();
      var g = trace.pop();
      if (!p) return this.root = x;
      if (!g || !trace.length) return this.root = this.uptree(x, p, g);
      if (trace[trace.length - 1].left == g) trace[trace.length - 1].left = x = this.uptree(x, p, g);
      else trace[trace.length - 1].right = x = this.uptree(x, p, g);
    }
  }

  insert(key) {
    if (!this.root) return this.root = new Node(key);
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      cur = key < cur.key ? cur.left : cur.right;
    }
    cur = trace[trace.length - 1];
    if (key < cur.key) trace.push[cur.left = new Node(key)];
    else trace.push[cur.right = new Node(key)];
    cur.update();
    this.splay(trace);
  }

  join(tree) {
    if (!this.root) return this.root = tree.root;
    var trace = [this.root];
    var cur = this.root;
    while (cur.right) trace.push(cur = cur.right);
    this.splay(trace);
    this.root.right = tree.root;
    this.root.update();
  }

  remove(key) {
    if (!this.root) return;
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      if (cur.key == key) break;
      cur = key < cur.key ? cur.left : cur.right;
    }
    if (trace[trace.length - 1].key != key) return;
    this.splay(trace);
    var tree = new SplayTree(this.root.right);
    this.root = this.root.left;
    this.join(tree);
  }

  min() {
    return this.root ? this.root.min : undefined;
  }

  max() {
    return this.root ? this.root.max : undefined;
  }

  print() {
    console.log(this.root ? this.root.toString() : undefined);
  }
}

// var t = new SplayTree();
// var arr = Array(10).fill(0).map(v => Math.random() * 100 | 0);
// arr.forEach(v => {
//   t.insert(v);
//   t.print();
// });
// console.log('---');
// arr.forEach(v => {
//   t.remove(v);
//   t.print();
// })

var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
  inputResolve();
});
(async () => {
  await inputPromise;
  var inp = input.split(/\D+/m).map(v => +v), r = 0;
  var n = inp[r++], k = inp[r++];
  var h = inp.slice(r, r = r + n);
  var t = new SplayTree();
  t.insert(h[0]);
  var max = 1, i = j = 0;
  var allRes = [];
  // console.log(n,k,h);
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      t.insert(h[j]);
      if (t.max() - t.min() > k) break;
    }
    if (max < j - i) {
      max = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (max == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    t.remove(h[i++]);
    while (t.max() - t.min() > k) {
      t.remove(h[i++]);
    }
  }
  console.log(max, allRes.length);
  console.log(allRes.join('\n'));
})();

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn, init) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
  if (b < a) return [];
  let arr = Array(b - a + 1).fill(0);
  if (init) init(arr);
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn(v)).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}

function gcd(a, b) {
  if (!b) return a;
  return gcd(b, a % b);
}
function mod(a, n, m) {
  if (n == 0n) return 1n;
  if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);
  return a * mod(a, n - 1n, m) % m;
}
function extendedEuclid(a, b) {
  if (!b) return [1, 0];
  else {
    let [x, y] = extendedEuclid(b, a % b);
    return [y, x - (a / b | 0) * y];
  }
}
// [m] = extendedEuclid(a, 998244353);
// let MOD = 998244353n;
// let gt = Arr(n, (i, a) => i == 0 ? 1n : a[i - 1] * BigInt(i) % MOD);
// let rgt = Arr(n, (i, a) => i <= 1 ? 1n : MOD - MOD / BigInt(i) * a[998244353 % i] % MOD);
// for (let i = 2; i < n; i++) rgt[i] = rgt[i] * rgt[i - 1] % MOD;
// let nCk = (n, k) => gt[n] * rgt[k] * rgt[n - k] % MOD;
// for (let i = dm[l.l]; i <= n + n; i += i & -i) s[i]++; // start from index 1

// let p = [2, 3, 5];
// for (let i = 6; i < 1e5; i += 6) {
//   let j, x = i + 1;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
//   x = i + 5;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;
  let n = $(), k = $(), h = $(n), t = new SplayTree();
  t.insert(h[0]);
  var maxRes = 1, i = j = 0;
  var allRes = [];
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      t.insert(h[j]);
      if (t.max() - t.min() > k) break;
    }
    if (maxRes < j - i) {
      maxRes = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (maxRes == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    t.remove(h[i++]);
    while (t.max() - t.min() > k) {
      t.remove(h[i++]);
    }
  }
  log(maxRes, allRes.length);
  log(allRes.join('\n'));
}

class Node {
  left; right; key; max; min;
  constructor(key) {
    this.key = key;
    this.max = key;
    this.min = key;
  }
  update() {
    if (this.left && this.right) {
      this.max = Math.max(this.key, this.left.max, this.right.max);
      this.min = Math.min(this.key, this.left.min, this.right.min);
    } else if (this.left) {
      this.max = Math.max(this.key, this.left.max);
      this.min = Math.min(this.key, this.left.min);
    } else if (this.right) {
      this.max = Math.max(this.key, this.right.max);
      this.min = Math.min(this.key, this.right.min);
    } else {
      this.max = this.key;
      this.min = this.key;
    }
  }
  toString() {
    return (this.left ? this.left.toString() + ' ' : '') + `(${this.key},${this.max},${this.min},${this.maxGap})` + (this.right ? ' ' + this.right.toString() : '')
  }
}

class SplayTree {
  root;
  constructor(node) {
    this.root = node;
  }

  uptree(x, p, g) {
    if (!g) {
      // lazy update p, x
      if (p.left == x) {
        p.left = x.right;
        x.right = p;
      } else {
        p.right = x.left;
        x.left = p;
      }
      p.update(); x.update();
      return x;
    }
    // lazy update g, p, x
    if (g.left == p && p.left == x) {
      g.left = p.right;
      p.right = g;
      p.left = x.right;
      x.right = p;
    } else if (g.right == p && p.right == x) {
      g.right = p.left;
      p.left = g;
      p.right = x.left;
      x.left = p;
    } else if (g.left == p) {
      p.right = x.left;
      x.left = p;
      g.left = x.right;
      x.right = g;
    } else {
      p.left = x.right;
      x.right = p;
      g.right = x.left;
      x.left = g;
    }
    g.update(); p.update(); x.update();
    return x;
  }

  splay(trace) {
    var x = trace.pop();
    while (true) {
      var p = trace.pop();
      var g = trace.pop();
      if (!p) return this.root = x;
      if (!g || !trace.length) return this.root = this.uptree(x, p, g);
      if (trace[trace.length - 1].left == g) trace[trace.length - 1].left = x = this.uptree(x, p, g);
      else trace[trace.length - 1].right = x = this.uptree(x, p, g);
    }
  }

  insert(key) {
    if (!this.root) return this.root = new Node(key);
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      cur = key < cur.key ? cur.left : cur.right;
    }
    cur = trace[trace.length - 1];
    if (key < cur.key) trace.push(cur.left = new Node(key));
    else trace.push(cur.right = new Node(key));
    this.splay(trace);
  }

  join(tree) {
    if (!this.root) return this.root = tree.root;
    var trace = [this.root];
    var cur = this.root;
    while (cur.right) trace.push(cur = cur.right);
    this.splay(trace);
    this.root.right = tree.root;
    this.root.update();
  }

  remove(key) {
    if (!this.root) return;
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      if (cur.key == key) break;
      cur = key < cur.key ? cur.left : cur.right;
    }
    if (trace[trace.length - 1].key != key) return;
    this.splay(trace);
    var tree = new SplayTree(this.root.right);
    this.root = this.root.left;
    this.join(tree);
  }

  load(nodes) {
    if (!nodes.length) return;
    this.root = nodes[0];
    let s = 1, k = 1;
    while (s < nodes.length) {
      let end = Math.min(s + k, nodes.length - 1);
      for (let i = end - 1; i >= s; i--) {
        nodes[i].right = nodes[i + 1];
        nodes[i].update();
      }
      this.root = nodes[s];
      this.root.left = nodes[s - k];
      this.root.update()
      s += ++k;
    }
  }

  max() {
    return this.root ? this.root.max : 0;
  }

  min() {
    return this.root ? this.root.min : 0;
  }

  print() {
    console.log(this.root ? this.root.toString() : undefined);
  }
}

/**
 *  10.12 night
 *  https://codeforces.com/problemset/problem/6/E
 *
 *  reference:
 *  https://codeforces.com/problemset/status/6/problem/E/page/46?order=BY_PROGRAM_LENGTH_ASC
 *  https://codeforces.com/problemset/submission/6/94367599
 */

function For(a, b, fn) {
    if (!fn) return For(0, a - 1, b);
    let res;
    for (let i = a; i <= b; i++) {
        if ((res = fn(i)) != null) return res;
    }
}

function ForR(a, b, fn) {
    if (!fn) return ForR(a - 1, 0, b);
    let res;
    for (let i = a; i >= b; i--) {
        if ((res = fn(i)) != null) return res;
    }
}

function Arr(a, b, fn, init) {
    if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
    if (b < a) return [];
    let arr = Array(b - a + 1).fill(0);
    if (init) init(arr);
    for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
    return arr;
}

Object.defineProperty(Object.prototype, '$k', {
    value: function () {
        return Object.keys(this)
    }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () {
        return Object.values(this)
    }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () {
        return Object.entries(this)
    }
});
Array.prototype.sum = function (fn) {
    return this.reduce((p, v) => p + (fn ? fn(v) : v), 0)
};
Array.prototype.uniq = function (fn) {
    let set = new Set();
    return this.filter(v => {
        let newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn ? fn(v) : v).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {})
};
Array.prototype.min = function (fn) {
    let min = 1e20, index = -1, x;
    for (let i = 0; i < this.length; i++) {
        x = fn ? fn(this[i], i, this) : this[i];
        if (x < min) {
            min = x;
            index = i
        }
    }
    return [this[index], index, min];
};
Array.prototype.max = function (fn) {
    let max = -1e20, index = -1, x;
    for (let i = 0; i < this.length; i++) {
        x = fn ? fn(this[i], i, this) : this[i];
        if (x > max) {
            max = x;
            index = i
        }
    }
    return [this[index], index, max];
};
Array.prototype.rev = function (first, last) {
    for (let i = first; i < (first + last) / 2; i++) {
        [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
    }
};
Array.prototype.set = function (pos, arr) {
    for (let i = pos; i < pos + arr.length; i++) {
        this[i] = arr[i - pos];
    }
};
Array.prototype.for = function (a, b, fn) {
    let res;
    for (let i = a; i <= b; i++) {
        if ((res = fn(this[i], i, this)) != null) return res;
    }
};
Array.prototype.forR = function (a, b, fn) {
    let res
    for (let i = a; i >= b; i--) {
        if ((res = fn(this[i], i, this)) != null) return res;
    }
};

function gcd(a, b) {
    while (b) [a, b] = [b, a % b];
    return a;
}

function mul(a, b, m) {
    return ((a >> 16) * b % m * 65536 + (a & 65535) * b) % m
}

function pow(a, n, m) {
    let r = 1;
    while (n) n & 1 ? (r = mul(r, a, m), n--) : [a, n] = [mul(a, a, m), n >> 1]
    return r;
}

let MOD = 998244353;

function inv(b) {
    for (let a = MOD, u = 0, v = 1, t; b; v = t)
        (t = a / b | 0, a -= t * b, u -= t * v, t = a, a = b, b = t, t = u, u = v);
    return (u + MOD) % MOD;
}

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);

function main() {
    let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
        out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max,
        abs = Math.abs;

    let [n, k] = $(2), h = $(n), tree = new AVLTree();
    tree.insert(h[0]);
    let Max = 1;
    let allRes = [];
    let i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j]) break;
            tree.insert(h[j]);
            if (tree.max() - tree.min() > k) break;
        }
        if (Max < j - i) {
            Max = j - i;
            allRes = [(i + 1) + ' ' + j];
        } else if (Max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        Max = max(j - i, Max);
        tree.remove(h[i++]);
        while (tree.max() - tree.min() > k) {
            tree.remove(h[i++]);
        }
    }
    log(Max, allRes.length);
    log(allRes.join('\n'));
}

let AVLTree = (function () {
    function print(root, printNode) {
        if (printNode === void 0) printNode = function (n) {
            return n.key;
        };

        let out = [];
        row(root, '', true, function (v) {
            return out.push(v);
        }, printNode);
        return out.join('');
    }

    function isBalanced(root) {
        if (root === null) {
            return true;
        }
        let lh = height(root.left);
        let rh = height(root.right);
        if (Math.abs(lh - rh) <= 1 &&
            isBalanced(root.left) &&
            isBalanced(root.right)) {
            return true;
        }
        return false;
    }

    function height(node) {
        return node ? (1 + Math.max(height(node.left), height(node.right))) : 0;
    }

    function loadRecursive(parent, keys, values, start, end) {
        let size = end - start;
        if (size > 0) {
            let middle = start + Math.floor(size / 2);
            let key = keys[middle];
            let data = values[middle];
            let node = { key: key, data: data, parent: parent };
            node.left = loadRecursive(node, keys, values, start, middle);
            node.right = loadRecursive(node, keys, values, middle + 1, end);
            return node;
        }
        return null;
    }

    function markBalance(node) {
        if (node === null) {
            return 0;
        }
        let lh = markBalance(node.left);
        let rh = markBalance(node.right);

        node.balanceFactor = lh - rh;
        return Math.max(lh, rh) + 1;
    }

    function sort(keys, values, left, right, compare) {
        if (left >= right) {
            return;
        }
        let pivot = keys[(left + right) >> 1];
        let i = left - 1;
        let j = right + 1;
        while (true) {
            do {
                i++;
            } while (compare(keys[i], pivot) < 0);
            do {
                j--;
            } while (compare(keys[j], pivot) > 0);
            if (i >= j) {
                break;
            }
            let tmp = keys[i];
            keys[i] = keys[j];
            keys[j] = tmp;

            tmp = values[i];
            values[i] = values[j];
            values[j] = tmp;
        }

        sort(keys, values, left, j, compare);
        sort(keys, values, j + 1, right, compare);
    }

    function DEFAULT_COMPARE(a, b) {
        return a > b ? 1 : a < b ? -1 : 0;
    }

    function rotateLeft(node) {
        let rightNode = node.right;
        node.right = rightNode.left;

        if (rightNode.left) {
            rightNode.left.parent = node;
        }

        rightNode.parent = node.parent;
        if (rightNode.parent) {
            if (rightNode.parent.left === node) {
                rightNode.parent.left = rightNode;
            } else {
                rightNode.parent.right = rightNode;
            }
        }

        node.parent = rightNode;
        rightNode.left = node;

        node.balanceFactor += 1;
        if (rightNode.balanceFactor < 0) {
            node.balanceFactor -= rightNode.balanceFactor;
        }

        rightNode.balanceFactor += 1;
        if (node.balanceFactor > 0) {
            rightNode.balanceFactor += node.balanceFactor;
        }
        return rightNode;
    }

    function rotateRight(node) {
        let leftNode = node.left;
        node.left = leftNode.right;
        if (node.left) {
            node.left.parent = node;
        }

        leftNode.parent = node.parent;
        if (leftNode.parent) {
            if (leftNode.parent.left === node) {
                leftNode.parent.left = leftNode;
            } else {
                leftNode.parent.right = leftNode;
            }
        }

        node.parent = leftNode;
        leftNode.right = node;

        node.balanceFactor -= 1;
        if (leftNode.balanceFactor > 0) {
            node.balanceFactor -= leftNode.balanceFactor;
        }

        leftNode.balanceFactor -= 1;
        if (node.balanceFactor < 0) {
            leftNode.balanceFactor += node.balanceFactor;
        }

        return leftNode;
    }

    let AVLTree = function AVLTree(comparator, noDuplicates) {
        if (noDuplicates === void 0) noDuplicates = false;

        this._comparator = comparator || DEFAULT_COMPARE;
        this._root = null;
        this._size = 0;
        this._noDuplicates = !!noDuplicates;
    };

    let prototypeAccessors = { size: { configurable: true } };

    AVLTree.prototype.destroy = function destroy() {
        return this.clear();
    };

    AVLTree.prototype.clear = function clear() {
        this._root = null;
        this._size = 0;
        return this;
    };

    prototypeAccessors.size.get = function () {
        return this._size;
    };

    AVLTree.prototype.contains = function contains(key) {
        if (this._root) {
            let node = this._root;
            let comparator = this._comparator;
            while (node) {
                let cmp = comparator(key, node.key);
                if (cmp === 0) {
                    return true;
                } else if (cmp < 0) {
                    node = node.left;
                } else {
                    node = node.right;
                }
            }
        }
        return false;
    };

    AVLTree.prototype.next = function next(node) {
        let successor = node;
        if (successor) {
            if (successor.right) {
                successor = successor.right;
                while (successor.left) {
                    successor = successor.left;
                }
            } else {
                successor = node.parent;
                while (successor && successor.right === node) {
                    node = successor;
                    successor = successor.parent;
                }
            }
        }
        return successor;
    };

    AVLTree.prototype.prev = function prev(node) {
        let predecessor = node;
        if (predecessor) {
            if (predecessor.left) {
                predecessor = predecessor.left;
                while (predecessor.right) {
                    predecessor = predecessor.right;
                }
            } else {
                predecessor = node.parent;
                while (predecessor && predecessor.left === node) {
                    node = predecessor;
                    predecessor = predecessor.parent;
                }
            }
        }
        return predecessor;
    };

    AVLTree.prototype.forEach = function forEach(callback) {
        let current = this._root;
        let s = [], done = false, i = 0;
        while (!done) {
            if (current) {
                s.push(current);
                current = current.left;
            } else {
                if (s.length > 0) {
                    current = s.pop();
                    callback(current, i++);
                    current = current.right;
                } else {
                    done = true;
                }
            }
        }
        return this;
    };

    AVLTree.prototype.range = function range(low, high, fn, ctx) {
        let this$1 = this;
        let Q = [];
        let compare = this._comparator;
        let node = this._root, cmp;
        while (Q.length !== 0 || node) {
            if (node) {
                Q.push(node);
                node = node.left;
            } else {
                node = Q.pop();
                cmp = compare(node.key, high);
                if (cmp > 0) {
                    break;
                } else if (compare(node.key, low) >= 0) {
                    if (fn.call(ctx, node)) {
                        return this$1;
                    }
                }
                node = node.right;
            }
        }
        return this;
    };

    AVLTree.prototype.keys = function keys() {
        let current = this._root;
        let s = [], r = [], done = false;
        while (!done) {
            if (current) {
                s.push(current);
                current = current.left;
            } else {
                if (s.length > 0) {
                    current = s.pop();
                    r.push(current.key);
                    current = current.right;
                } else {
                    done = true;
                }
            }
        }
        return r;
    };

    AVLTree.prototype.values = function values() {
        let current = this._root;
        let s = [], r = [], done = false;
        while (!done) {
            if (current) {
                s.push(current);
                current = current.left;
            } else {
                if (s.length > 0) {
                    current = s.pop();
                    r.push(current.data);
                    current = current.right;
                } else {
                    done = true;
                }
            }
        }
        return r;
    };

    AVLTree.prototype.at = function at(index) {
        let current = this._root;
        let s = [], done = false, i = 0;
        while (!done) {
            if (current) {
                s.push(current);
                current = current.left;
            } else {
                if (s.length > 0) {
                    current = s.pop();
                    if (i === index) {
                        return current;
                    }
                    i++;
                    current = current.right;
                } else {
                    done = true;
                }
            }
        }
        return null;
    };

    AVLTree.prototype.minNode = function minNode() {
        let node = this._root;
        if (!node) {
            return null;
        }
        while (node.left) {
            node = node.left;
        }
        return node;
    };

    AVLTree.prototype.maxNode = function maxNode() {
        let node = this._root;
        if (!node) {
            return null;
        }
        while (node.right) {
            node = node.right;
        }
        return node;
    };

    AVLTree.prototype.min = function min() {
        let node = this._root;
        if (!node) {
            return null;
        }
        while (node.left) {
            node = node.left;
        }
        return node.key;
    };

    AVLTree.prototype.max = function max() {
        let node = this._root;
        if (!node) {
            return null;
        }
        while (node.right) {
            node = node.right;
        }
        return node.key;
    };

    AVLTree.prototype.isEmpty = function isEmpty() {
        return !this._root;
    };

    AVLTree.prototype.pop = function pop() {
        let node = this._root, returnValue = null;
        if (node) {
            while (node.left) {
                node = node.left;
            }
            returnValue = { key: node.key, data: node.data };
            this.remove(node.key);
        }
        return returnValue;
    };

    AVLTree.prototype.find = function find(key) {
        let root = this._root;
        let subtree = root, cmp;
        let compare = this._comparator;
        while (subtree) {
            cmp = compare(key, subtree.key);
            if (cmp === 0) {
                return subtree;
            } else if (cmp < 0) {
                subtree = subtree.left;
            } else {
                subtree = subtree.right;
            }
        }

        return null;
    };

    AVLTree.prototype.insert = function insert(key, data) {
        let this$1 = this;
        if (!this._root) {
            this._root = {
                parent: null, left: null, right: null, balanceFactor: 0,
                key: key, data: data
            };
            this._size++;
            return this._root;
        }

        let compare = this._comparator;
        let node = this._root;
        let parent = null;
        let cmp = 0;

        if (this._noDuplicates) {
            while (node) {
                cmp = compare(key, node.key);
                parent = node;
                if (cmp === 0) {
                    return null;
                } else if (cmp < 0) {
                    node = node.left;
                } else {
                    node = node.right;
                }
            }
        } else {
            while (node) {
                cmp = compare(key, node.key);
                parent = node;
                if (cmp <= 0) {
                    node = node.left;
                } //return null;
                else {
                    node = node.right;
                }
            }
        }

        let newNode = {
            left: null,
            right: null,
            balanceFactor: 0,
            parent: parent, key: key, data: data
        };
        let newRoot;
        if (cmp <= 0) {
            parent.left = newNode;
        } else {
            parent.right = newNode;
        }

        while (parent) {
            cmp = compare(parent.key, key);
            if (cmp < 0) {
                parent.balanceFactor -= 1;
            } else {
                parent.balanceFactor += 1;
            }

            if (parent.balanceFactor === 0) {
                break;
            } else if (parent.balanceFactor < -1) {
                if (parent.right.balanceFactor === 1) {
                    rotateRight(parent.right);
                }
                newRoot = rotateLeft(parent);
                if (parent === this$1._root) {
                    this$1._root = newRoot;
                }
                break;
            } else if (parent.balanceFactor > 1) {
                if (parent.left.balanceFactor === -1) {
                    rotateLeft(parent.left);
                }
                newRoot = rotateRight(parent);

                if (parent === this$1._root) {
                    this$1._root = newRoot;
                }
                break;
            }
            parent = parent.parent;
        }

        this._size++;
        return newNode;
    };

    AVLTree.prototype.remove = function remove(key) {
        let this$1 = this;
        if (!this._root) {
            return null;
        }
        let node = this._root;
        let compare = this._comparator;
        let cmp = 0;
        while (node) {
            cmp = compare(key, node.key);
            if (cmp === 0) {
                break;
            } else if (cmp < 0) {
                node = node.left;
            } else {
                node = node.right;
            }
        }
        if (!node) {
            return null;
        }

        let returnValue = node.key;
        let max, min;

        if (node.left) {
            max = node.left;

            while (max.left || max.right) {
                while (max.right) {
                    max = max.right;
                }

                node.key = max.key;
                node.data = max.data;
                if (max.left) {
                    node = max;
                    max = max.left;
                }
            }

            node.key = max.key;
            node.data = max.data;
            node = max;
        }

        if (node.right) {
            min = node.right;

            while (min.left || min.right) {
                while (min.left) {
                    min = min.left;
                }

                node.key = min.key;
                node.data = min.data;
                if (min.right) {
                    node = min;
                    min = min.right;
                }
            }

            node.key = min.key;
            node.data = min.data;
            node = min;
        }

        let parent = node.parent;
        let pp = node;
        let newRoot;

        while (parent) {
            if (parent.left === pp) {
                parent.balanceFactor -= 1;
            } else {
                parent.balanceFactor += 1;
            }

            if (parent.balanceFactor < -1) {
                if (parent.right.balanceFactor === 1) {
                    rotateRight(parent.right);
                }
                newRoot = rotateLeft(parent);

                if (parent === this$1._root) {
                    this$1._root = newRoot;
                }
                parent = newRoot;
            } else if (parent.balanceFactor > 1) {
                if (parent.left.balanceFactor === -1) {
                    rotateLeft(parent.left);
                }
                newRoot = rotateRight(parent);
                if (parent === this$1._root) {
                    this$1._root = newRoot;
                }
                parent = newRoot;
            }
            if (parent.balanceFactor === -1 || parent.balanceFactor === 1) {
                break;
            }
            pp = parent;
            parent = parent.parent;
        }

        if (node.parent) {
            if (node.parent.left === node) {
                node.parent.left = null;
            } else {
                node.parent.right = null;
            }
        }

        if (node === this._root) {
            this._root = null;
        }

        this._size--;
        return returnValue;
    };

    AVLTree.prototype.load = function load(keys, values, presort) {
        if (keys === void 0) keys = [];
        if (values === void 0) values = [];

        if (this._size !== 0) {
            throw new Error('bulk-load: tree is not empty');
        }
        let size = keys.length;
        if (presort) {
            sort(keys, values, 0, size - 1, this._comparator);
        }
        this._root = loadRecursive(null, keys, values, 0, size);
        markBalance(this._root);
        this._size = size;
        return this;
    };

    AVLTree.prototype.isBalanced = function isBalanced$1() {
        return isBalanced(this._root);
    };

    AVLTree.prototype.toString = function toString(printNode) {
        return print(this._root, printNode);
    };

    Object.defineProperties(AVLTree.prototype, prototypeAccessors);

    AVLTree.default = AVLTree;

    return AVLTree;

})();

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var t = new BSTree();
    t.insert(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            t.insert(h[j]);
            // console.log(i, j, hk, t.print());
            if (t.key(j - i) - t.key(0) > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        // console.log(t.print(), i, j, h[i])
        t.remove(h[i++]);
        while (t.key(j - i) - t.key(0) > k) {
            // console.log('NOOO', i, j, h[i]);
            t.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - time)
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class BSNode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        var left = this.left;
        if (!left)
            return;
        this.left = left.right;
        left.right = this;
        this.update();
        left.update();
    }
    rotateLeft() {
        var right = this.right;
        if (!right)
            return;
        this.right = right.left;
        right.left = this;
        this.update();
        right.update();
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}
class BSTree {
    constructor(root) {
        this.root = root;
    }
    at(index) {
        var node = this.root;
        while (node) {
            var sizeLeft = node.left ? node.left.size : 0;
            if (sizeLeft == index)
                return node;
            if (index < sizeLeft)
                node = node.left;
            else {
                node = node.right;
                index -= sizeLeft + 1;
            }
        }
        return undefined;
    }
    key(index) {
        var _a;
        return ((_a = this.at(index)) === null || _a === void 0 ? void 0 : _a.key) || 0;
    }
    insert(key) {
        if (!this.root)
            return this.root = new BSNode(key);
        var parent = undefined;
        var node = this.root;
        while (true) {
            var left = node.left;
            var right = node.right;
            var sizeLeft = left ? left.size : 0;
            var sizeRight = right ? right.size : 0;
            var sizeLeftLeft = left && left.left ? left.left.size : 0;
            var sizeLeftRight = left && left.right ? left.right.size : 0;
            var sizeRightLeft = right && right.left ? right.left.size : 0;
            var sizeRightRight = right && right.right ? right.right.size : 0;
            var dif = Math.abs(sizeLeft - sizeRight);
            if (Math.abs(1 + sizeRight + sizeLeftRight - sizeLeftLeft) < dif) {
                node.rotateRight();
                if (!parent)
                    this.root = left;
                else {
                    if (parent.left == node)
                        parent.left = left;
                    else
                        parent.right = left;
                }
                node = left;
                continue;
            }
            if (Math.abs(1 + sizeLeft + sizeRightLeft - sizeRightRight) < dif) {
                node.rotateLeft();
                if (!parent)
                    this.root = right;
                else {
                    if (parent.left == node)
                        parent.left = right;
                    else
                        parent.right = right;
                }
                node = right;
                continue;
            }
            if (key < node.key) {
                node.size++;
                if (!left)
                    return node.left = new BSNode(key);
                parent = node;
                node = left;
            }
            else {
                node.size++;
                if (!right)
                    return node.right = new BSNode(key);
                parent = node;
                node = right;
            }
        }
    }
    remove(key) {
        var parent = undefined;
        var node = this.root;
        while (node && node.key != key) {
            parent = node;
            node.size--;
            if (key < node.key)
                node = node.left;
            else
                node = node.right;
        }
        if (!node)
            return;
        var right = node.right;
        if (!right) {
            if (!parent) {
                this.root = node.left;
            }
            else {
                if (parent.left == node)
                    parent.left = node.left;
                else
                    parent.right = node.left;
            }
            return;
        }
        var rightParent = node;
        while (right && right.left) {
            rightParent = right;
            right.size--;
            right = right.left;
        }
        node.key = right.key;
        if (rightParent.left == right)
            rightParent.left = right.right;
        else
            rightParent.right = right.right;
        node.size--;
    }
    print() {
        console.log(this.root ? this.root.print() : undefined);
    }
}

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn, init) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
  if (b < a) return [];
  let arr = Array(b - a + 1).fill(0);
  if (init) init(arr);
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn ? fn(v) : v).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}

function gcd(a, b) {
  while (b) [a, b] = [b, a % b];
  return a;
}
function mul(a, b, m) {
  return ((a >> 16) * b % m * 65536 + (a & 65535) * b) % m
}
function pow(a, n, m) {
  let r = 1;
  while (n) n & 1 ? (r = mul(r, a, m), n--) : [a, n] = [mul(a, a, m), n >> 1]
  return r;
}
let MOD = 998244353
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = a / b | 0, a -= t * b, u -= t * v, t = a, a = b, b = t, t = u, u = v);
  return (u + MOD) % MOD;
}

// let gt = Arr(n, (i, a) => i == 0 ? 1 : mul(a[i - 1], i, MOD));
// let rgt = Arr(n, (i, a) => i <= 1 ? 1 : MOD - mul((MOD / i | 0), a[998244353 % i], MOD));
// For(2, n - 1, i => { rgt[i] = mul(rgt[i], rgt[i - 1], MOD) });
// let nCk = (n, k) => mul(mul(gt[n], rgt[k], MOD), rgt[n - k], MOD);

// for (i = pos; i <= n; i += i & -i) fen[i]++; // start from index 1
// for (i = pos; i; i -= i & -i) ans += fen[i];

// let p = [2];
// for (let i = 3; i < 1e5; i += 2) {
//   let j, x = Math.sqrt(i);
//   for (j = 0; p[j] <= x; j++) if (i % p[j] == 0) break;
//   if (i % p[j] != 0) p.push(i);
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;

  let [n, k] = $(2), h = $(n), tree = new AVLTree();
  tree.insert(h[0]);
  var Max = 1;
  var allRes = [];
  var i = 0, j = 0;
  while (i < n) {
    while (j < n) {
      j++;
      if (!h[j]) break;
      tree.insert(h[j]);
      if (tree.max() - tree.min() > k) break;
    }
    if (Max < j - i) {
      Max = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (Max == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    Max = max(j - i, Max);
    tree.remove(h[i++]);
    while (tree.max() - tree.min() > k) {
      tree.remove(h[i++]);
    }
  }
  log(Max, allRes.length);
  log(allRes.join('\n'));
}

var AVLTree = (function () {
  /**
   * Prints tree horizontally
   * @param  {Node}                       root
   * @param  {Function(node:Node):String} [printNode]
   * @return {String}
   */
  function print(root, printNode) {
    if (printNode === void 0) printNode = function (n) { return n.key; };

    var out = [];
    row(root, '', true, function (v) { return out.push(v); }, printNode);
    return out.join('');
  }

  /**
   * Is the tree balanced (none of the subtrees differ in height by more than 1)
   * @param  {Node}    root
   * @return {Boolean}
   */
  function isBalanced(root) {
    if (root === null) { return true; } // If node is empty then return true

    // Get the height of left and right sub trees
    var lh = height(root.left);
    var rh = height(root.right);

    if (Math.abs(lh - rh) <= 1 &&
      isBalanced(root.left) &&
      isBalanced(root.right)) { return true; }

    // If we reach here then tree is not height-balanced
    return false;
  }

  /**
   * The function Compute the 'height' of a tree.
   * Height is the number of nodes along the longest path
   * from the root node down to the farthest leaf node.
   *
   * @param  {Node} node
   * @return {Number}
   */
  function height(node) {
    return node ? (1 + Math.max(height(node.left), height(node.right))) : 0;
  }

  function loadRecursive(parent, keys, values, start, end) {
    var size = end - start;
    if (size > 0) {
      var middle = start + Math.floor(size / 2);
      var key = keys[middle];
      var data = values[middle];
      var node = { key: key, data: data, parent: parent };
      node.left = loadRecursive(node, keys, values, start, middle);
      node.right = loadRecursive(node, keys, values, middle + 1, end);
      return node;
    }
    return null;
  }

  function markBalance(node) {
    if (node === null) { return 0; }
    var lh = markBalance(node.left);
    var rh = markBalance(node.right);

    node.balanceFactor = lh - rh;
    return Math.max(lh, rh) + 1;
  }

  function sort(keys, values, left, right, compare) {
    if (left >= right) { return; }

    // eslint-disable-next-line no-bitwise
    var pivot = keys[(left + right) >> 1];
    var i = left - 1;
    var j = right + 1;

    // eslint-disable-next-line no-constant-condition
    while (true) {
      do { i++; } while (compare(keys[i], pivot) < 0);
      do { j--; } while (compare(keys[j], pivot) > 0);
      if (i >= j) { break; }

      var tmp = keys[i];
      keys[i] = keys[j];
      keys[j] = tmp;

      tmp = values[i];
      values[i] = values[j];
      values[j] = tmp;
    }

    sort(keys, values, left, j, compare);
    sort(keys, values, j + 1, right, compare);
  }

  // function createNode (parent, left, right, height, key, data) {
  //   return { parent, left, right, balanceFactor: height, key, data };
  // }

  /**
   * @typedef {{
   *   parent:        ?Node,
   *   left:          ?Node,
   *   right:         ?Node,
   *   balanceFactor: number,
   *   key:           Key,
   *   data:          Value
   * }} Node
   */

  /**
   * @typedef {*} Key
   */

  /**
   * @typedef {*} Value
   */

  /**
   * Default comparison function
   * @param {Key} a
   * @param {Key} b
   * @returns {number}
   */
  function DEFAULT_COMPARE(a, b) { return a > b ? 1 : a < b ? -1 : 0; }

  /**
   * Single left rotation
   * @param  {Node} node
   * @return {Node}
   */
  function rotateLeft(node) {
    var rightNode = node.right;
    node.right = rightNode.left;

    if (rightNode.left) { rightNode.left.parent = node; }

    rightNode.parent = node.parent;
    if (rightNode.parent) {
      if (rightNode.parent.left === node) {
        rightNode.parent.left = rightNode;
      } else {
        rightNode.parent.right = rightNode;
      }
    }

    node.parent = rightNode;
    rightNode.left = node;

    node.balanceFactor += 1;
    if (rightNode.balanceFactor < 0) {
      node.balanceFactor -= rightNode.balanceFactor;
    }

    rightNode.balanceFactor += 1;
    if (node.balanceFactor > 0) {
      rightNode.balanceFactor += node.balanceFactor;
    }
    return rightNode;
  }

  function rotateRight(node) {
    var leftNode = node.left;
    node.left = leftNode.right;
    if (node.left) { node.left.parent = node; }

    leftNode.parent = node.parent;
    if (leftNode.parent) {
      if (leftNode.parent.left === node) {
        leftNode.parent.left = leftNode;
      } else {
        leftNode.parent.right = leftNode;
      }
    }

    node.parent = leftNode;
    leftNode.right = node;

    node.balanceFactor -= 1;
    if (leftNode.balanceFactor > 0) {
      node.balanceFactor -= leftNode.balanceFactor;
    }

    leftNode.balanceFactor -= 1;
    if (node.balanceFactor < 0) {
      leftNode.balanceFactor += node.balanceFactor;
    }

    return leftNode;
  }

  // function leftBalance (node) {
  //   if (node.left.balanceFactor === -1) rotateLeft(node.left);
  //   return rotateRight(node);
  // }

  // function rightBalance (node) {
  //   if (node.right.balanceFactor === 1) rotateRight(node.right);
  //   return rotateLeft(node);
  // }

  var AVLTree = function AVLTree(comparator, noDuplicates) {
    if (noDuplicates === void 0) noDuplicates = false;

    this._comparator = comparator || DEFAULT_COMPARE;
    this._root = null;
    this._size = 0;
    this._noDuplicates = !!noDuplicates;
  };

  var prototypeAccessors = { size: { configurable: true } };

  /**
   * Clear the tree
   * @return {AVLTree}
   */
  AVLTree.prototype.destroy = function destroy() {
    return this.clear();
  };

  /**
   * Clear the tree
   * @return {AVLTree}
   */
  AVLTree.prototype.clear = function clear() {
    this._root = null;
    this._size = 0;
    return this;
  };

  /**
   * Number of nodes
   * @return {number}
   */
  prototypeAccessors.size.get = function () {
    return this._size;
  };

  /**
   * Whether the tree contains a node with the given key
   * @param{Key} key
   * @return {boolean} true/false
   */
  AVLTree.prototype.contains = function contains(key) {
    if (this._root) {
      var node = this._root;
      var comparator = this._comparator;
      while (node) {
        var cmp = comparator(key, node.key);
        if (cmp === 0) { return true; }
        else if (cmp < 0) { node = node.left; }
        else { node = node.right; }
      }
    }
    return false;
  };

  /* eslint-disable class-methods-use-this */

  /**
   * Successor node
   * @param{Node} node
   * @return {?Node}
   */
  AVLTree.prototype.next = function next(node) {
    var successor = node;
    if (successor) {
      if (successor.right) {
        successor = successor.right;
        while (successor.left) { successor = successor.left; }
      } else {
        successor = node.parent;
        while (successor && successor.right === node) {
          node = successor; successor = successor.parent;
        }
      }
    }
    return successor;
  };

  /**
   * Predecessor node
   * @param{Node} node
   * @return {?Node}
   */
  AVLTree.prototype.prev = function prev(node) {
    var predecessor = node;
    if (predecessor) {
      if (predecessor.left) {
        predecessor = predecessor.left;
        while (predecessor.right) { predecessor = predecessor.right; }
      } else {
        predecessor = node.parent;
        while (predecessor && predecessor.left === node) {
          node = predecessor;
          predecessor = predecessor.parent;
        }
      }
    }
    return predecessor;
  };
  /* eslint-enable class-methods-use-this */

  /**
   * Callback for forEach
   * @callback forEachCallback
   * @param {Node} node
   * @param {number} index
   */

  /**
   * @param{forEachCallback} callback
   * @return {AVLTree}
   */
  AVLTree.prototype.forEach = function forEach(callback) {
    var current = this._root;
    var s = [], done = false, i = 0;

    while (!done) {
      // Reach the left most Node of the current Node
      if (current) {
        // Place pointer to a tree node on the stack
        // before traversing the node's left subtree
        s.push(current);
        current = current.left;
      } else {
        // BackTrack from the empty subtree and visit the Node
        // at the top of the stack; however, if the stack is
        // empty you are done
        if (s.length > 0) {
          current = s.pop();
          callback(current, i++);

          // We have visited the node and its left
          // subtree. Now, it's right subtree's turn
          current = current.right;
        } else { done = true; }
      }
    }
    return this;
  };

  AVLTree.prototype.range = function range(low, high, fn, ctx) {
    var this$1 = this;

    var Q = [];
    var compare = this._comparator;
    var node = this._root, cmp;

    while (Q.length !== 0 || node) {
      if (node) {
        Q.push(node);
        node = node.left;
      } else {
        node = Q.pop();
        cmp = compare(node.key, high);
        if (cmp > 0) {
          break;
        } else if (compare(node.key, low) >= 0) {
          if (fn.call(ctx, node)) { return this$1; } // stop if smth is returned
        }
        node = node.right;
      }
    }
    return this;
  };

  /**
   * Returns all keys in order
   * @return {Array<Key>}
   */
  AVLTree.prototype.keys = function keys() {
    var current = this._root;
    var s = [], r = [], done = false;

    while (!done) {
      if (current) {
        s.push(current);
        current = current.left;
      } else {
        if (s.length > 0) {
          current = s.pop();
          r.push(current.key);
          current = current.right;
        } else { done = true; }
      }
    }
    return r;
  };

  AVLTree.prototype.values = function values() {
    var current = this._root;
    var s = [], r = [], done = false;

    while (!done) {
      if (current) {
        s.push(current);
        current = current.left;
      } else {
        if (s.length > 0) {
          current = s.pop();
          r.push(current.data);
          current = current.right;
        } else { done = true; }
      }
    }
    return r;
  };

  /**
   * Returns node at given index
   * @param{number} index
   * @return {?Node}
   */
  AVLTree.prototype.at = function at(index) {
    // removed after a consideration, more misleading than useful
    // index = index % this.size;
    // if (index < 0) index = this.size - index;

    var current = this._root;
    var s = [], done = false, i = 0;

    while (!done) {
      if (current) {
        s.push(current);
        current = current.left;
      } else {
        if (s.length > 0) {
          current = s.pop();
          if (i === index) { return current; }
          i++;
          current = current.right;
        } else { done = true; }
      }
    }
    return null;
  };

  /**
   * Returns node with the minimum key
   * @return {?Node}
   */
  AVLTree.prototype.minNode = function minNode() {
    var node = this._root;
    if (!node) { return null; }
    while (node.left) { node = node.left; }
    return node;
  };

  /**
   * Returns node with the max key
   * @return {?Node}
   */
  AVLTree.prototype.maxNode = function maxNode() {
    var node = this._root;
    if (!node) { return null; }
    while (node.right) { node = node.right; }
    return node;
  };

  /**
   * Min key
   * @return {?Key}
   */
  AVLTree.prototype.min = function min() {
    var node = this._root;
    if (!node) { return null; }
    while (node.left) { node = node.left; }
    return node.key;
  };

  /**
   * Max key
   * @return {?Key}
   */
  AVLTree.prototype.max = function max() {
    var node = this._root;
    if (!node) { return null; }
    while (node.right) { node = node.right; }
    return node.key;
  };

  /**
   * @return {boolean} true/false
   */
  AVLTree.prototype.isEmpty = function isEmpty() {
    return !this._root;
  };

  /**
   * Removes and returns the node with smallest key
   * @return {?Node}
   */
  AVLTree.prototype.pop = function pop() {
    var node = this._root, returnValue = null;
    if (node) {
      while (node.left) { node = node.left; }
      returnValue = { key: node.key, data: node.data };
      this.remove(node.key);
    }
    return returnValue;
  };

  /**
   * Find node by key
   * @param{Key} key
   * @return {?Node}
   */
  AVLTree.prototype.find = function find(key) {
    var root = this._root;
    // if (root === null)  return null;
    // if (key === root.key) return root;

    var subtree = root, cmp;
    var compare = this._comparator;
    while (subtree) {
      cmp = compare(key, subtree.key);
      if (cmp === 0) { return subtree; }
      else if (cmp < 0) { subtree = subtree.left; }
      else { subtree = subtree.right; }
    }

    return null;
  };

  /**
   * Insert a node into the tree
   * @param{Key} key
   * @param{Value} [data]
   * @return {?Node}
   */
  AVLTree.prototype.insert = function insert(key, data) {
    var this$1 = this;

    if (!this._root) {
      this._root = {
        parent: null, left: null, right: null, balanceFactor: 0,
        key: key, data: data
      };
      this._size++;
      return this._root;
    }

    var compare = this._comparator;
    var node = this._root;
    var parent = null;
    var cmp = 0;

    if (this._noDuplicates) {
      while (node) {
        cmp = compare(key, node.key);
        parent = node;
        if (cmp === 0) { return null; }
        else if (cmp < 0) { node = node.left; }
        else { node = node.right; }
      }
    } else {
      while (node) {
        cmp = compare(key, node.key);
        parent = node;
        if (cmp <= 0) { node = node.left; } //return null;
        else { node = node.right; }
      }
    }

    var newNode = {
      left: null,
      right: null,
      balanceFactor: 0,
      parent: parent, key: key, data: data
    };
    var newRoot;
    if (cmp <= 0) { parent.left = newNode; }
    else { parent.right = newNode; }

    while (parent) {
      cmp = compare(parent.key, key);
      if (cmp < 0) { parent.balanceFactor -= 1; }
      else { parent.balanceFactor += 1; }

      if (parent.balanceFactor === 0) { break; }
      else if (parent.balanceFactor < -1) {
        // inlined
        //var newRoot = rightBalance(parent);
        if (parent.right.balanceFactor === 1) { rotateRight(parent.right); }
        newRoot = rotateLeft(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        break;
      } else if (parent.balanceFactor > 1) {
        // inlined
        // var newRoot = leftBalance(parent);
        if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); }
        newRoot = rotateRight(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        break;
      }
      parent = parent.parent;
    }

    this._size++;
    return newNode;
  };

  /**
   * Removes the node from the tree. If not found, returns null.
   * @param{Key} key
   * @return {?Node}
   */
  AVLTree.prototype.remove = function remove(key) {
    var this$1 = this;

    if (!this._root) { return null; }

    var node = this._root;
    var compare = this._comparator;
    var cmp = 0;

    while (node) {
      cmp = compare(key, node.key);
      if (cmp === 0) { break; }
      else if (cmp < 0) { node = node.left; }
      else { node = node.right; }
    }
    if (!node) { return null; }

    var returnValue = node.key;
    var max, min;

    if (node.left) {
      max = node.left;

      while (max.left || max.right) {
        while (max.right) { max = max.right; }

        node.key = max.key;
        node.data = max.data;
        if (max.left) {
          node = max;
          max = max.left;
        }
      }

      node.key = max.key;
      node.data = max.data;
      node = max;
    }

    if (node.right) {
      min = node.right;

      while (min.left || min.right) {
        while (min.left) { min = min.left; }

        node.key = min.key;
        node.data = min.data;
        if (min.right) {
          node = min;
          min = min.right;
        }
      }

      node.key = min.key;
      node.data = min.data;
      node = min;
    }

    var parent = node.parent;
    var pp = node;
    var newRoot;

    while (parent) {
      if (parent.left === pp) { parent.balanceFactor -= 1; }
      else { parent.balanceFactor += 1; }

      if (parent.balanceFactor < -1) {
        // inlined
        //var newRoot = rightBalance(parent);
        if (parent.right.balanceFactor === 1) { rotateRight(parent.right); }
        newRoot = rotateLeft(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        parent = newRoot;
      } else if (parent.balanceFactor > 1) {
        // inlined
        // var newRoot = leftBalance(parent);
        if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); }
        newRoot = rotateRight(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        parent = newRoot;
      }

      if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; }

      pp = parent;
      parent = parent.parent;
    }

    if (node.parent) {
      if (node.parent.left === node) { node.parent.left = null; }
      else { node.parent.right = null; }
    }

    if (node === this._root) { this._root = null; }

    this._size--;
    return returnValue;
  };

  /**
   * Bulk-load items
   * @param{Array<Key>}keys
   * @param{Array<Value>}[values]
   * @return {AVLTree}
   */
  AVLTree.prototype.load = function load(keys, values, presort) {
    if (keys === void 0) keys = [];
    if (values === void 0) values = [];

    if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); }
    var size = keys.length;
    if (presort) { sort(keys, values, 0, size - 1, this._comparator); }
    this._root = loadRecursive(null, keys, values, 0, size);
    markBalance(this._root);
    this._size = size;
    return this;
  };

  /**
   * Returns true if the tree is balanced
   * @return {boolean}
   */
  AVLTree.prototype.isBalanced = function isBalanced$1() {
    return isBalanced(this._root);
  };

  /**
   * String representation of the tree - primitive horizontal print-out
   * @param{Function(Node):string} [printNode]
   * @return {string}
   */
  AVLTree.prototype.toString = function toString(printNode) {
    return print(this._root, printNode);
  };

  Object.defineProperties(AVLTree.prototype, prototypeAccessors);

  AVLTree.default = AVLTree;

  return AVLTree;

})();

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var t = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var tree = new AVLTree();
    tree.insert(h[0]);
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            tree.insert(h[j]);
            if (tree.max() - tree.min() > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        max = Math.max(j - i, max);
        tree.remove(h[i++]);
        while (tree.max() - tree.min() > k) {
            tree.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - t)
})();
var AVLTree = eval(`
(function () { 'use strict';

  /**
   * Prints tree horizontally
   * @param  {Node}                       root
   * @param  {Function(node:Node):String} [printNode]
   * @return {String}
   */
  function print (root, printNode) {
    if ( printNode === void 0 ) printNode = function (n) { return n.key; };

    var out = [];
    row(root, '', true, function (v) { return out.push(v); }, printNode);
    return out.join('');
  }

  /**
   * Is the tree balanced (none of the subtrees differ in height by more than 1)
   * @param  {Node}    root
   * @return {Boolean}
   */
  function isBalanced(root) {
    if (root === null) { return true; } // If node is empty then return true

    // Get the height of left and right sub trees
    var lh = height(root.left);
    var rh = height(root.right);

    if (Math.abs(lh - rh) <= 1 &&
        isBalanced(root.left)  &&
        isBalanced(root.right)) { return true; }

    // If we reach here then tree is not height-balanced
    return false;
  }

  /**
   * The function Compute the 'height' of a tree.
   * Height is the number of nodes along the longest path
   * from the root node down to the farthest leaf node.
   *
   * @param  {Node} node
   * @return {Number}
   */
  function height(node) {
    return node ? (1 + Math.max(height(node.left), height(node.right))) : 0;
  }

  function loadRecursive (parent, keys, values, start, end) {
    var size = end - start;
    if (size > 0) {
      var middle = start + Math.floor(size / 2);
      var key    = keys[middle];
      var data   = values[middle];
      var node   = { key: key, data: data, parent: parent };
      node.left    = loadRecursive(node, keys, values, start, middle);
      node.right   = loadRecursive(node, keys, values, middle + 1, end);
      return node;
    }
    return null;
  }

  function markBalance(node) {
    if (node === null) { return 0; }
    var lh = markBalance(node.left);
    var rh = markBalance(node.right);

    node.balanceFactor = lh - rh;
    return Math.max(lh, rh) + 1;
  }

  function sort(keys, values, left, right, compare) {
    if (left >= right) { return; }

    // eslint-disable-next-line no-bitwise
    var pivot = keys[(left + right) >> 1];
    var i = left - 1;
    var j = right + 1;

    // eslint-disable-next-line no-constant-condition
    while (true) {
      do { i++; } while (compare(keys[i], pivot) < 0);
      do { j--; } while (compare(keys[j], pivot) > 0);
      if (i >= j) { break; }

      var tmp = keys[i];
      keys[i] = keys[j];
      keys[j] = tmp;

      tmp = values[i];
      values[i] = values[j];
      values[j] = tmp;
    }

    sort(keys, values,  left,     j, compare);
    sort(keys, values, j + 1, right, compare);
  }

  // function createNode (parent, left, right, height, key, data) {
  //   return { parent, left, right, balanceFactor: height, key, data };
  // }

  /**
   * @typedef {{
   *   parent:        ?Node,
   *   left:          ?Node,
   *   right:         ?Node,
   *   balanceFactor: number,
   *   key:           Key,
   *   data:          Value
   * }} Node
   */

  /**
   * @typedef {*} Key
   */

  /**
   * @typedef {*} Value
   */

  /**
   * Default comparison function
   * @param {Key} a
   * @param {Key} b
   * @returns {number}
   */
  function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }

  /**
   * Single left rotation
   * @param  {Node} node
   * @return {Node}
   */
  function rotateLeft (node) {
    var rightNode = node.right;
    node.right    = rightNode.left;

    if (rightNode.left) { rightNode.left.parent = node; }

    rightNode.parent = node.parent;
    if (rightNode.parent) {
      if (rightNode.parent.left === node) {
        rightNode.parent.left = rightNode;
      } else {
        rightNode.parent.right = rightNode;
      }
    }

    node.parent    = rightNode;
    rightNode.left = node;

    node.balanceFactor += 1;
    if (rightNode.balanceFactor < 0) {
      node.balanceFactor -= rightNode.balanceFactor;
    }

    rightNode.balanceFactor += 1;
    if (node.balanceFactor > 0) {
      rightNode.balanceFactor += node.balanceFactor;
    }
    return rightNode;
  }

  function rotateRight (node) {
    var leftNode = node.left;
    node.left = leftNode.right;
    if (node.left) { node.left.parent = node; }

    leftNode.parent = node.parent;
    if (leftNode.parent) {
      if (leftNode.parent.left === node) {
        leftNode.parent.left = leftNode;
      } else {
        leftNode.parent.right = leftNode;
      }
    }

    node.parent    = leftNode;
    leftNode.right = node;

    node.balanceFactor -= 1;
    if (leftNode.balanceFactor > 0) {
      node.balanceFactor -= leftNode.balanceFactor;
    }

    leftNode.balanceFactor -= 1;
    if (node.balanceFactor < 0) {
      leftNode.balanceFactor += node.balanceFactor;
    }

    return leftNode;
  }

  // function leftBalance (node) {
  //   if (node.left.balanceFactor === -1) rotateLeft(node.left);
  //   return rotateRight(node);
  // }

  // function rightBalance (node) {
  //   if (node.right.balanceFactor === 1) rotateRight(node.right);
  //   return rotateLeft(node);
  // }

  var AVLTree = function AVLTree (comparator, noDuplicates) {
    if ( noDuplicates === void 0 ) noDuplicates = false;

    this._comparator = comparator || DEFAULT_COMPARE;
    this._root = null;
    this._size = 0;
    this._noDuplicates = !!noDuplicates;
  };

  var prototypeAccessors = { size: { configurable: true } };

  /**
   * Clear the tree
   * @return {AVLTree}
   */
  AVLTree.prototype.destroy = function destroy () {
    return this.clear();
  };

  /**
   * Clear the tree
   * @return {AVLTree}
   */
  AVLTree.prototype.clear = function clear () {
    this._root = null;
    this._size = 0;
    return this;
  };

  /**
   * Number of nodes
   * @return {number}
   */
  prototypeAccessors.size.get = function () {
    return this._size;
  };

  /**
   * Whether the tree contains a node with the given key
   * @param{Key} key
   * @return {boolean} true/false
   */
  AVLTree.prototype.contains = function contains (key) {
    if (this._root){
      var node     = this._root;
      var comparator = this._comparator;
      while (node){
        var cmp = comparator(key, node.key);
        if    (cmp === 0) { return true; }
        else if (cmp < 0) { node = node.left; }
        else              { node = node.right; }
      }
    }
    return false;
  };

  /* eslint-disable class-methods-use-this */

  /**
   * Successor node
   * @param{Node} node
   * @return {?Node}
   */
  AVLTree.prototype.next = function next (node) {
    var successor = node;
    if (successor) {
      if (successor.right) {
        successor = successor.right;
        while (successor.left) { successor = successor.left; }
      } else {
        successor = node.parent;
        while (successor && successor.right === node) {
          node = successor; successor = successor.parent;
        }
      }
    }
    return successor;
  };

  /**
   * Predecessor node
   * @param{Node} node
   * @return {?Node}
   */
  AVLTree.prototype.prev = function prev (node) {
    var predecessor = node;
    if (predecessor) {
      if (predecessor.left) {
        predecessor = predecessor.left;
        while (predecessor.right) { predecessor = predecessor.right; }
      } else {
        predecessor = node.parent;
        while (predecessor && predecessor.left === node) {
          node = predecessor;
          predecessor = predecessor.parent;
        }
      }
    }
    return predecessor;
  };
  /* eslint-enable class-methods-use-this */

  /**
   * Callback for forEach
   * @callback forEachCallback
   * @param {Node} node
   * @param {number} index
   */

  /**
   * @param{forEachCallback} callback
   * @return {AVLTree}
   */
  AVLTree.prototype.forEach = function forEach (callback) {
    var current = this._root;
    var s = [], done = false, i = 0;

    while (!done) {
      // Reach the left most Node of the current Node
      if (current) {
        // Place pointer to a tree node on the stack
        // before traversing the node's left subtree
        s.push(current);
        current = current.left;
      } else {
        // BackTrack from the empty subtree and visit the Node
        // at the top of the stack; however, if the stack is
        // empty you are done
        if (s.length > 0) {
          current = s.pop();
          callback(current, i++);

          // We have visited the node and its left
          // subtree. Now, it's right subtree's turn
          current = current.right;
        } else { done = true; }
      }
    }
    return this;
  };

  AVLTree.prototype.range = function range (low, high, fn, ctx) {
      var this$1 = this;

    var Q = [];
    var compare = this._comparator;
    var node = this._root, cmp;

    while (Q.length !== 0 || node) {
      if (node) {
        Q.push(node);
        node = node.left;
      } else {
        node = Q.pop();
        cmp = compare(node.key, high);
        if (cmp > 0) {
          break;
        } else if (compare(node.key, low) >= 0) {
          if (fn.call(ctx, node)) { return this$1; } // stop if smth is returned
        }
        node = node.right;
      }
    }
    return this;
  };

  /**
   * Returns all keys in order
   * @return {Array<Key>}
   */
  AVLTree.prototype.keys = function keys () {
    var current = this._root;
    var s = [], r = [], done = false;

    while (!done) {
      if (current) {
        s.push(current);
        current = current.left;
      } else {
        if (s.length > 0) {
          current = s.pop();
          r.push(current.key);
          current = current.right;
        } else { done = true; }
      }
    }
    return r;
  };

  AVLTree.prototype.values = function values () {
    var current = this._root;
    var s = [], r = [], done = false;

    while (!done) {
      if (current) {
        s.push(current);
        current = current.left;
      } else {
        if (s.length > 0) {
          current = s.pop();
          r.push(current.data);
          current = current.right;
        } else { done = true; }
      }
    }
    return r;
  };

  /**
   * Returns node at given index
   * @param{number} index
   * @return {?Node}
   */
  AVLTree.prototype.at = function at (index) {
    // removed after a consideration, more misleading than useful
    // index = index % this.size;
    // if (index < 0) index = this.size - index;

    var current = this._root;
    var s = [], done = false, i = 0;

    while (!done) {
      if (current) {
        s.push(current);
        current = current.left;
      } else {
        if (s.length > 0) {
          current = s.pop();
          if (i === index) { return current; }
          i++;
          current = current.right;
        } else { done = true; }
      }
    }
    return null;
  };

  /**
   * Returns node with the minimum key
   * @return {?Node}
   */
  AVLTree.prototype.minNode = function minNode () {
    var node = this._root;
    if (!node) { return null; }
    while (node.left) { node = node.left; }
    return node;
  };

  /**
   * Returns node with the max key
   * @return {?Node}
   */
  AVLTree.prototype.maxNode = function maxNode () {
    var node = this._root;
    if (!node) { return null; }
    while (node.right) { node = node.right; }
    return node;
  };

  /**
   * Min key
   * @return {?Key}
   */
  AVLTree.prototype.min = function min () {
    var node = this._root;
    if (!node) { return null; }
    while (node.left) { node = node.left; }
    return node.key;
  };

  /**
   * Max key
   * @return {?Key}
   */
  AVLTree.prototype.max = function max () {
    var node = this._root;
    if (!node) { return null; }
    while (node.right) { node = node.right; }
    return node.key;
  };

  /**
   * @return {boolean} true/false
   */
  AVLTree.prototype.isEmpty = function isEmpty () {
    return !this._root;
  };

  /**
   * Removes and returns the node with smallest key
   * @return {?Node}
   */
  AVLTree.prototype.pop = function pop () {
    var node = this._root, returnValue = null;
    if (node) {
      while (node.left) { node = node.left; }
      returnValue = { key: node.key, data: node.data };
      this.remove(node.key);
    }
    return returnValue;
  };

  /**
   * Find node by key
   * @param{Key} key
   * @return {?Node}
   */
  AVLTree.prototype.find = function find (key) {
    var root = this._root;
    // if (root === null)  return null;
    // if (key === root.key) return root;

    var subtree = root, cmp;
    var compare = this._comparator;
    while (subtree) {
      cmp = compare(key, subtree.key);
      if    (cmp === 0) { return subtree; }
      else if (cmp < 0) { subtree = subtree.left; }
      else              { subtree = subtree.right; }
    }

    return null;
  };

  /**
   * Insert a node into the tree
   * @param{Key} key
   * @param{Value} [data]
   * @return {?Node}
   */
  AVLTree.prototype.insert = function insert (key, data) {
      var this$1 = this;

    if (!this._root) {
      this._root = {
        parent: null, left: null, right: null, balanceFactor: 0,
        key: key, data: data
      };
      this._size++;
      return this._root;
    }

    var compare = this._comparator;
    var node  = this._root;
    var parent= null;
    var cmp   = 0;

    if (this._noDuplicates) {
      while (node) {
        cmp = compare(key, node.key);
        parent = node;
        if    (cmp === 0) { return null; }
        else if (cmp < 0) { node = node.left; }
        else              { node = node.right; }
      }
    } else {
      while (node) {
        cmp = compare(key, node.key);
        parent = node;
        if    (cmp <= 0){ node = node.left; } //return null;
        else              { node = node.right; }
      }
    }

    var newNode = {
      left: null,
      right: null,
      balanceFactor: 0,
      parent: parent, key: key, data: data
    };
    var newRoot;
    if (cmp <= 0) { parent.left= newNode; }
    else       { parent.right = newNode; }

    while (parent) {
      cmp = compare(parent.key, key);
      if (cmp < 0) { parent.balanceFactor -= 1; }
      else       { parent.balanceFactor += 1; }

      if      (parent.balanceFactor === 0) { break; }
      else if (parent.balanceFactor < -1) {
        // inlined
        //var newRoot = rightBalance(parent);
        if (parent.right.balanceFactor === 1) { rotateRight(parent.right); }
        newRoot = rotateLeft(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        break;
      } else if (parent.balanceFactor > 1) {
        // inlined
        // var newRoot = leftBalance(parent);
        if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); }
        newRoot = rotateRight(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        break;
      }
      parent = parent.parent;
    }

    this._size++;
    return newNode;
  };

  /**
   * Removes the node from the tree. If not found, returns null.
   * @param{Key} key
   * @return {?Node}
   */
  AVLTree.prototype.remove = function remove (key) {
      var this$1 = this;

    if (!this._root) { return null; }

    var node = this._root;
    var compare = this._comparator;
    var cmp = 0;

    while (node) {
      cmp = compare(key, node.key);
      if    (cmp === 0) { break; }
      else if (cmp < 0) { node = node.left; }
      else              { node = node.right; }
    }
    if (!node) { return null; }

    var returnValue = node.key;
    var max, min;

    if (node.left) {
      max = node.left;

      while (max.left || max.right) {
        while (max.right) { max = max.right; }

        node.key = max.key;
        node.data = max.data;
        if (max.left) {
          node = max;
          max = max.left;
        }
      }

      node.key= max.key;
      node.data = max.data;
      node = max;
    }

    if (node.right) {
      min = node.right;

      while (min.left || min.right) {
        while (min.left) { min = min.left; }

        node.key= min.key;
        node.data = min.data;
        if (min.right) {
          node = min;
          min = min.right;
        }
      }

      node.key= min.key;
      node.data = min.data;
      node = min;
    }

    var parent = node.parent;
    var pp   = node;
    var newRoot;

    while (parent) {
      if (parent.left === pp) { parent.balanceFactor -= 1; }
      else                  { parent.balanceFactor += 1; }

      if      (parent.balanceFactor < -1) {
        // inlined
        //var newRoot = rightBalance(parent);
        if (parent.right.balanceFactor === 1) { rotateRight(parent.right); }
        newRoot = rotateLeft(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        parent = newRoot;
      } else if (parent.balanceFactor > 1) {
        // inlined
        // var newRoot = leftBalance(parent);
        if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); }
        newRoot = rotateRight(parent);

        if (parent === this$1._root) { this$1._root = newRoot; }
        parent = newRoot;
      }

      if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; }

      pp   = parent;
      parent = parent.parent;
    }

    if (node.parent) {
      if (node.parent.left === node) { node.parent.left= null; }
      else                         { node.parent.right = null; }
    }

    if (node === this._root) { this._root = null; }

    this._size--;
    return returnValue;
  };

  /**
   * Bulk-load items
   * @param{Array<Key>}keys
   * @param{Array<Value>}[values]
   * @return {AVLTree}
   */
  AVLTree.prototype.load = function load (keys, values, presort) {
      if ( keys === void 0 ) keys = [];
      if ( values === void 0 ) values = [];

    if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); }
    var size = keys.length;
    if (presort) { sort(keys, values, 0, size - 1, this._comparator); }
    this._root = loadRecursive(null, keys, values, 0, size);
    markBalance(this._root);
    this._size = size;
    return this;
  };

  /**
   * Returns true if the tree is balanced
   * @return {boolean}
   */
  AVLTree.prototype.isBalanced = function isBalanced$1 () {
    return isBalanced(this._root);
  };

  /**
   * String representation of the tree - primitive horizontal print-out
   * @param{Function(Node):string} [printNode]
   * @return {string}
   */
  AVLTree.prototype.toString = function toString (printNode) {
    return print(this._root, printNode);
  };

  Object.defineProperties( AVLTree.prototype, prototypeAccessors );

  AVLTree.default = AVLTree;

  return AVLTree;

})()
`);

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var t = new BSTree();
    // h.forEach(v => t.insert(v));
    // console.log(Date.now() - time);
    // return;
    t.insert(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            t.insert(h[j]);
            // console.log(i, j, hk, t.print());
            if (t.key(j - i) - t.key(0) > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        // console.log(t.print(), i, j, h[i])
        t.remove(h[i++]);
        while (t.key(j - i) - t.key(0) > k) {
            // console.log('NOOO', i, j, h[i]);
            t.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - time)
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class BSNode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        var left = this.left;
        if (!left)
            return;
        this.left = left.right;
        left.right = this;
        this.update();
        left.update();
    }
    rotateLeft() {
        var right = this.right;
        if (!right)
            return;
        this.right = right.left;
        right.left = this;
        this.update();
        right.update();
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}
class BSTree {
    constructor(root) {
        this.root = root;
    }
    at(index) {
        var node = this.root;
        while (node) {
            var sizeLeft = node.left ? node.left.size : 0;
            if (sizeLeft == index)
                return node;
            if (index < sizeLeft)
                node = node.left;
            else {
                node = node.right;
                index -= sizeLeft + 1;
            }
        }
        return undefined;
    }
    key(index) {
        var _a;
        return ((_a = this.at(index)) === null || _a === void 0 ? void 0 : _a.key) || 0;
    }
    balance(node, parent) {
        var left = node.left;
        var right = node.right;
        var sizeLeft = left ? left.size : 0;
        var sizeRight = right ? right.size : 0;
        var sizeLeftLeft = left && left.left ? left.left.size : 0;
        var sizeLeftRight = left && left.right ? left.right.size : 0;
        var sizeRightLeft = right && right.left ? right.left.size : 0;
        var sizeRightRight = right && right.right ? right.right.size : 0;
        var dif = Math.abs(sizeLeft - sizeRight);
        if (Math.abs(1 + sizeRight + sizeLeftRight - sizeLeftLeft) < dif) {
            node.rotateRight();
            if (!parent)
                this.root = left;
            else {
                if (parent.left == node)
                    parent.left = left;
                else
                    parent.right = left;
            }
            return left;
        }
        else if (Math.abs(1 + sizeLeft + sizeRightLeft - sizeRightRight) < dif) {
            node.rotateLeft();
            if (!parent)
                this.root = right;
            else {
                if (parent.left == node)
                    parent.left = right;
                else
                    parent.right = right;
            }
            return right;
        }
        return node;
    }
    insert(key) {
        if (!this.root)
            return this.root = new BSNode(key);
        var parent = undefined;
        var node = this.root;
        while (true) {
            node = this.balance(node, parent);
            if (key < node.key) {
                node.size++;
                if (!node.left)
                    return node.left = new BSNode(key);
                parent = node;
                node = node.left;
            }
            else {
                node.size++;
                if (!node.right)
                    return node.right = new BSNode(key);
                parent = node;
                node = node.right;
            }
        }
    }
    join(tree) {
        if (!this.root)
            return this.root = tree.root;
        var node = this.root;
        var right = node.right;
        while (right) {
            node.rotateLeft();
            node = right;
            right = right.right;
        }
        node.right = tree.root;
        node.update();
        this.root = node;
    }
    remove(key) {
        var parent = undefined;
        var node = this.root;
        while (node && node.key != key) {
            node = this.balance(node, parent);
            if (node.key == key)
                break;
            parent = node;
            node.size--;
            if (key < node.key)
                node = node.left;
            else
                node = node.right;
        }
        if (!node)
            return;
        var newTree = new BSTree(node.left);
        newTree.join(new BSTree(node.right));
        if (!parent)
            return this.root = newTree.root;
        if (parent.left == node)
            parent.left = newTree.root;
        else
            parent.right = newTree.root;
    }
    print() {
        console.log(this.root ? this.root.print() : undefined);
    }
}

class Node {
  next; key;
  constructor(key, MAX_LAYER) {
    this.key = key;
    this.next = Array(MAX_LAYER);
  }
}

class SkipList {
  head; MAX_LAYER;
  constructor(MAX_LAYER = 3) {
    this.MAX_LAYER = MAX_LAYER;
    this.head = new Node(-1e10, MAX_LAYER);
    for (let i = 0; i < MAX_LAYER; i++)this.head.next[i] = null;
  }

  insert(key) {
    var cur = this.head;
    var layer = this.MAX_LAYER - 1;
    var trace = [];
    while (layer >= 0) {
      while (cur.next[layer] && cur.next[layer].key < key) {
        cur = cur.next[layer];
      }
      if (trace[trace.length - 1] != cur) trace.push(cur);
      layer--;
    }
    var node = new Node(key);
    node.next[0] = cur.next[0];
    cur.next[0] = node;
    for (let i = 1; i < this.MAX_LAYER; i++) {
      if (Math.random() < 0.5) break;
      while (cur.next[i] === undefined) {
        cur = trace.pop();
      }
      node.next[i] = cur.next[i];
      cur.next[i] = node;
    }
  }

  remove(key) {
    var cur = this.head;
    var layer = this.MAX_LAYER - 1;
    var trace = [];
    while (layer >= 0) {
      while (cur.next[layer] && cur.next[layer].key < key) {
        cur = cur.next[layer];
      }
      if (trace[trace.length - 1] != cur) trace.push(cur);
      layer--;
    }
    var node = cur.next[0];
    if (!node || node.key != key) return;
    cur.next[0] = node.next[0];
    for (let i = 1; i < this.MAX_LAYER; i++) {
      if (node.next[i] === undefined) break;
      while (cur.next[i] != node) {
        cur = trace.pop();
      }
      cur.next[i] = node.next[i];
    }
  }

  min() {
    return (this.head.next[0] || {}).key;
  }

  max() {
    var cur = this.head;
    for (let i = this.MAX_LAYER - 1; i >= 0; i--) {
      while (cur.next[i]) cur = cur.next[i];
    }
    return cur != this.head ? cur.key : undefined;
  }

  print() {
    for (let i = 0; i < this.MAX_LAYER; i++) {
      let arr = [];
      let cur = this.head.next[i];
      while (cur) {
        arr.push(cur.key);
        cur = cur.next[i];
      }
      console.log(`Layer ${i}: ${arr.join(' ')}`)
    }
  }
}

// var t = Date.now();
// var sk = new SkipList(20);
// var arr = Array(1e5).fill(0).map(v => Math.random() * 1e9 | 0);
// arr.forEach(v => sk.insert(v));
// console.log(Date.now() - t);
// arr.forEach(v => sk.remove(v));
// console.log(Date.now() - t);

var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
  inputResolve();
});
(async () => {
  await inputPromise;
  var inputs = input.split(/\r?\n/);
  var [n, k] = inputs[0].split(' ').map(v => +v);
  var h = inputs[1].split(' ').map(v => +v);
  var sk = new SkipList(20);
  sk.insert(h[0]);
  var max = 1;
  var allRes = [];
  var i = 0, j = 0;
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      sk.insert(h[j]);
      if (sk.max() - sk.min() > k) break;
    }
    if (max < j - i) {
      max = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (max == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    sk.remove(h[i++]);
    while (sk.max() - sk.min() > k) {
      sk.remove(h[i++]);
    }
  }
  console.log(max, allRes.length);
  console.log(allRes.join('\n'));
})();

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn, init) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
  if (b < a) return [];
  let arr = Array(b - a + 1).fill(0);
  if (init) init(arr);
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn(v)).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}

function gcd(a, b) {
  if (!b) return a;
  return gcd(b, a % b);
}
function mod(a, n, m) {
  if (n == 0n) return 1n;
  if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);
  return a * mod(a, n - 1n, m) % m;
}
function extendedEuclid(a, b) {
  if (!b) return [1, 0];
  else {
    let [x, y] = extendedEuclid(b, a % b);
    return [y, x - (a / b | 0) * y];
  }
}
// [m] = extendedEuclid(a, 998244353);
// let MOD = 998244353n;
// let gt = Arr(n, (i, a) => i == 0 ? 1n : a[i - 1] * BigInt(i) % MOD);
// let rgt = Arr(n, (i, a) => i <= 1 ? 1n : MOD - MOD / BigInt(i) * a[998244353 % i] % MOD);
// for (let i = 2; i < n; i++) rgt[i] = rgt[i] * rgt[i - 1] % MOD;
// let nCk = (n, k) => gt[n] * rgt[k] * rgt[n - k] % MOD;
// for (let i = dm[l.l]; i <= n + n; i += i & -i) s[i]++; // start from index 1

// let p = [2, 3, 5];
// for (let i = 6; i < 1e5; i += 6) {
//   let j, x = i + 1;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
//   x = i + 5;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;
  let n = $(), k = $(), h = $(n);

  let m = {}, d = 0;
  h.slice().sort(asc).forEach(v => m[v] ? 0 : m[v] = ++d);
  let n2 = 1 << Math.ceil(Math.log2(n));
  let it = Arr(n2 * 2, i => ({ max: 0, min: 1e10, c: 0 }))
  let update = i => {
    let l = it[i << 1], r = it[i << 1 | 1];
    it[i] = {
      max: max(l.max, r.max),
      min: min(l.min, r.min),
      c: l.c + r.c
    }
  }
  let set = (i, v, c) => {
    i = n2 + i - 1;
    it[i].c += c;
    if (it[i].c <= 0) { it[i].max = 0; it[i].min = 1e10 }
    else { it[i].max = v; it[i].min = v }
    while (i > 1) update(i >>= 1);
  }

  set(m[h[0]], h[0], 1);
  var maxRes = 1, i = j = 0;
  var allRes = [];
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      set(m[h[j]], h[j], 1);
      if (it[1].max - it[1].min > k) break;
    }
    if (maxRes < j - i) {
      maxRes = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (maxRes == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    set(m[h[i]], h[i++], -1);
    while (it[1].max - it[1].min > k) {
      set(m[h[i]], h[i++], -1);
    }
  }
  log(maxRes, allRes.length);
  log(allRes.join('\n'));
}

class Node {
  left; right; key; max; min;
  constructor(key) {
    this.key = key;
    this.max = key;
    this.min = key;
  }
  update() {
    if (this.left && this.right) {
      this.max = Math.max(this.key, this.left.max, this.right.max);
      this.min = Math.min(this.key, this.left.min, this.right.min);
    } else if (this.left) {
      this.max = Math.max(this.key, this.left.max);
      this.min = Math.min(this.key, this.left.min);
    } else if (this.right) {
      this.max = Math.max(this.key, this.right.max);
      this.min = Math.min(this.key, this.right.min);
    } else {
      this.max = this.key;
      this.min = this.key;
    }
  }
  toString() {
    return (this.left ? this.left.toString() + ' ' : '') + `(${this.key},${this.max},${this.min},${this.maxGap})` + (this.right ? ' ' + this.right.toString() : '')
  }
}

class SplayTree {
  root;
  constructor(node) {
    this.root = node;
  }

  uptree(x, p, g) {
    if (!g) {
      // lazy update p, x
      if (p.left == x) {
        p.left = x.right;
        x.right = p;
      } else {
        p.right = x.left;
        x.left = p;
      }
      p.update(); x.update();
      return x;
    }
    // lazy update g, p, x
    if (g.left == p && p.left == x) {
      g.left = p.right;
      p.right = g;
      p.left = x.right;
      x.right = p;
    } else if (g.right == p && p.right == x) {
      g.right = p.left;
      p.left = g;
      p.right = x.left;
      x.left = p;
    } else if (g.left == p) {
      p.right = x.left;
      x.left = p;
      g.left = x.right;
      x.right = g;
    } else {
      p.left = x.right;
      x.right = p;
      g.right = x.left;
      x.left = g;
    }
    g.update(); p.update(); x.update();
    return x;
  }

  splay(trace) {
    var x = trace.pop();
    while (true) {
      var p = trace.pop();
      var g = trace.pop();
      if (!p) return this.root = x;
      if (!g || !trace.length) return this.root = this.uptree(x, p, g);
      if (trace[trace.length - 1].left == g) trace[trace.length - 1].left = x = this.uptree(x, p, g);
      else trace[trace.length - 1].right = x = this.uptree(x, p, g);
    }
  }

  insert(key) {
    if (!this.root) return this.root = new Node(key);
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      cur = key < cur.key ? cur.left : cur.right;
    }
    cur = trace[trace.length - 1];
    if (key < cur.key) trace.push(cur.left = new Node(key));
    else trace.push(cur.right = new Node(key));
    this.splay(trace);
  }

  join(tree) {
    if (!this.root) return this.root = tree.root;
    var trace = [this.root];
    var cur = this.root;
    while (cur.right) trace.push(cur = cur.right);
    this.splay(trace);
    this.root.right = tree.root;
    this.root.update();
  }

  remove(key) {
    if (!this.root) return;
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      if (cur.key == key) break;
      cur = key < cur.key ? cur.left : cur.right;
    }
    if (trace[trace.length - 1].key != key) return;
    this.splay(trace);
    var tree = new SplayTree(this.root.right);
    this.root = this.root.left;
    this.join(tree);
  }

  load(nodes) {
    if (!nodes.length) return;
    this.root = nodes[0];
    let s = 1, k = 1;
    while (s < nodes.length) {
      let end = Math.min(s + k, nodes.length - 1);
      for (let i = end - 1; i >= s; i--) {
        nodes[i].right = nodes[i + 1];
        nodes[i].update();
      }
      this.root = nodes[s];
      this.root.left = nodes[s - k];
      this.root.update()
      s += ++k;
    }
  }

  max() {
    return this.root ? this.root.max : 0;
  }

  min() {
    return this.root ? this.root.min : 0;
  }

  print() {
    console.log(this.root ? this.root.toString() : undefined);
  }
}

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn, init) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
  if (b < a) return [];
  let arr = Array(b - a + 1).fill(0);
  if (init) init(arr);
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn(v)).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}

function gcd(a, b) {
  if (!b) return a;
  return gcd(b, a % b);
}
function mod(a, n, m) {
  if (n == 0n) return 1n;
  if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);
  return a * mod(a, n - 1n, m) % m;
}
function extendedEuclid(a, b) {
  if (!b) return [1, 0];
  else {
    let [x, y] = extendedEuclid(b, a % b);
    return [y, x - (a / b | 0) * y];
  }
}
// [m] = extendedEuclid(a, 998244353);
// let MOD = 998244353n;
// let gt = Arr(n, (i, a) => i == 0 ? 1n : a[i - 1] * BigInt(i) % MOD);
// let rgt = Arr(n, (i, a) => i <= 1 ? 1n : MOD - MOD / BigInt(i) * a[998244353 % i] % MOD);
// for (let i = 2; i < n; i++) rgt[i] = rgt[i] * rgt[i - 1] % MOD;
// let nCk = (n, k) => gt[n] * rgt[k] * rgt[n - k] % MOD;
// for (let i = dm[l.l]; i <= n + n; i += i & -i) s[i]++; // start from index 1

// let p = [2, 3, 5];
// for (let i = 6; i < 1e5; i += 6) {
//   let j, x = i + 1;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
//   x = i + 5;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;
  let n = $(), k = $(), h = $(n);

  let m = {}, d = 0;
  h.slice().sort(asc).forEach(v => m[v] ? 0 : m[v] = ++d);
  let n2 = 1 << Math.ceil(Math.log2(n));
  let it = Array(n2 * 2);
  For(1, n2 + n2 - 1, i => { it[i] = { max: 0, min: 1e10, c: 0 } })

  let update = i => {
    let l = it[i << 1], r = it[i << 1 | 1];
    it[i] = {
      max: max(l.max, r.max),
      min: min(l.min, r.min),
      c: l.c + r.c
    }
  }
  let set = (i, v, c) => {
    i = n2 + i - 1;
    it[i].c += c;
    if (it[i].c <= 0) { it[i].max = 0; it[i].min = 1e10 }
    else { it[i].max = v; it[i].min = v }
    while (i > 1) update(i >>= 1);
  }

  set(m[h[0]], h[0], 1);
  var maxRes = 1, i = j = 0;
  var allRes = [];
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      set(m[h[j]], h[j], 1);
      if (it[1].max - it[1].min > k) break;
    }
    if (maxRes < j - i) {
      maxRes = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (maxRes == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    set(m[h[i]], h[i++], -1);
    while (it[1].max - it[1].min > k) {
      set(m[h[i]], h[i++], -1);
    }
  }
  log(maxRes, allRes.length);
  log(allRes.join('\n'));
}

class Node {
  left; right; key; max; min;
  constructor(key) {
    this.key = key;
    this.max = key;
    this.min = key;
  }
  update() {
    if (this.left && this.right) {
      this.max = Math.max(this.key, this.left.max, this.right.max);
      this.min = Math.min(this.key, this.left.min, this.right.min);
    } else if (this.left) {
      this.max = Math.max(this.key, this.left.max);
      this.min = Math.min(this.key, this.left.min);
    } else if (this.right) {
      this.max = Math.max(this.key, this.right.max);
      this.min = Math.min(this.key, this.right.min);
    } else {
      this.max = this.key;
      this.min = this.key;
    }
  }
  toString() {
    return (this.left ? this.left.toString() + ' ' : '') + `(${this.key},${this.max},${this.min},${this.maxGap})` + (this.right ? ' ' + this.right.toString() : '')
  }
}

class SplayTree {
  root;
  constructor(node) {
    this.root = node;
  }

  uptree(x, p, g) {
    if (!g) {
      // lazy update p, x
      if (p.left == x) {
        p.left = x.right;
        x.right = p;
      } else {
        p.right = x.left;
        x.left = p;
      }
      p.update(); x.update();
      return x;
    }
    // lazy update g, p, x
    if (g.left == p && p.left == x) {
      g.left = p.right;
      p.right = g;
      p.left = x.right;
      x.right = p;
    } else if (g.right == p && p.right == x) {
      g.right = p.left;
      p.left = g;
      p.right = x.left;
      x.left = p;
    } else if (g.left == p) {
      p.right = x.left;
      x.left = p;
      g.left = x.right;
      x.right = g;
    } else {
      p.left = x.right;
      x.right = p;
      g.right = x.left;
      x.left = g;
    }
    g.update(); p.update(); x.update();
    return x;
  }

  splay(trace) {
    var x = trace.pop();
    while (true) {
      var p = trace.pop();
      var g = trace.pop();
      if (!p) return this.root = x;
      if (!g || !trace.length) return this.root = this.uptree(x, p, g);
      if (trace[trace.length - 1].left == g) trace[trace.length - 1].left = x = this.uptree(x, p, g);
      else trace[trace.length - 1].right = x = this.uptree(x, p, g);
    }
  }

  insert(key) {
    if (!this.root) return this.root = new Node(key);
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      cur = key < cur.key ? cur.left : cur.right;
    }
    cur = trace[trace.length - 1];
    if (key < cur.key) trace.push(cur.left = new Node(key));
    else trace.push(cur.right = new Node(key));
    this.splay(trace);
  }

  join(tree) {
    if (!this.root) return this.root = tree.root;
    var trace = [this.root];
    var cur = this.root;
    while (cur.right) trace.push(cur = cur.right);
    this.splay(trace);
    this.root.right = tree.root;
    this.root.update();
  }

  remove(key) {
    if (!this.root) return;
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      if (cur.key == key) break;
      cur = key < cur.key ? cur.left : cur.right;
    }
    if (trace[trace.length - 1].key != key) return;
    this.splay(trace);
    var tree = new SplayTree(this.root.right);
    this.root = this.root.left;
    this.join(tree);
  }

  load(nodes) {
    if (!nodes.length) return;
    this.root = nodes[0];
    let s = 1, k = 1;
    while (s < nodes.length) {
      let end = Math.min(s + k, nodes.length - 1);
      for (let i = end - 1; i >= s; i--) {
        nodes[i].right = nodes[i + 1];
        nodes[i].update();
      }
      this.root = nodes[s];
      this.root.left = nodes[s - k];
      this.root.update()
      s += ++k;
    }
  }

  max() {
    return this.root ? this.root.max : 0;
  }

  min() {
    return this.root ? this.root.min : 0;
  }

  print() {
    console.log(this.root ? this.root.toString() : undefined);
  }
}

function For(a, b, fn) {
  if (!fn) return For(0, a - 1, b);
  let res;
  for (let i = a; i <= b; i++) {
    if ((res = fn(i)) != null) return res;
  }
}
function ForR(a, b, fn) {
  if (!fn) return ForR(a - 1, 0, b);
  let res;
  for (let i = a; i >= b; i--) {
    if ((res = fn(i)) != null) return res;
  }
}

function Arr(a, b, fn, init) {
  if (typeof (b) == 'function') return Arr(0, a - 1, b, fn);
  if (b < a) return [];
  let arr = Array(b - a + 1).fill(0);
  if (init) init(arr);
  for (let i = a; i <= b; i++) arr[i] = fn(i, arr);
  return arr;
}

Object.defineProperty(Object.prototype, '$k', {
  value: function () { return Object.keys(this) }
});
Object.defineProperty(Object.prototype, '$v', {
  value: function () { return Object.values(this) }
});
Object.defineProperty(Object.prototype, '$kv', {
  value: function () { return Object.entries(this) }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0) }
Array.prototype.uniq = function (fn) {
  var set = new Set();
  return this.filter(v => {
    var newValue = !set.has(fn ? fn(v) : v);
    set.add(fn ? fn(v) : v);
    return newValue;
  });
}
Array.prototype.toObj = function (fn) {
  return this.map(v => fn(v)).reduce((p, v) => {
    p[v[0]] = v[1];
    return p;
  }, {})
}
Array.prototype.min = function (fn) {
  let min = 1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x < min) { min = x; index = i }
  }
  return [this[index], index, min];
}
Array.prototype.max = function (fn) {
  let max = -1e20, index = -1, x;
  for (let i = 0; i < this.length; i++) {
    x = fn ? fn(this[i], i, this) : this[i];
    if (x > max) { max = x; index = i }
  }
  return [this[index], index, max];
}
Array.prototype.rev = function (first, last) {
  for (let i = first; i < (first + last) / 2; i++) {
    [this[i], this[last - 1 - i + first]] = [this[last - 1 - i + first], this[i]]
  }
}
Array.prototype.set = function (pos, arr) {
  for (let i = pos; i < pos + arr.length; i++) {
    this[i] = arr[i - pos];
  }
}
Array.prototype.for = function (a, b, fn) {
  let res
  for (let i = a; i <= b; i++) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}
Array.prototype.forR = function (a, b, fn) {
  let res
  for (let i = a; i >= b; i--) {
    if ((res = fn(this[i], i, this)) != null) return res;
  }
}

function gcd(a, b) {
  if (!b) return a;
  return gcd(b, a % b);
}
function mod(a, n, m) {
  if (n == 0n) return 1n;
  if (n % 2n == 0n) return mod(a * a % m, n / 2n, m);
  return a * mod(a, n - 1n, m) % m;
}
function extendedEuclid(a, b) {
  if (!b) return [1, 0];
  else {
    let [x, y] = extendedEuclid(b, a % b);
    return [y, x - (a / b | 0) * y];
  }
}
// [m] = extendedEuclid(a, 998244353);
// let MOD = 998244353n;
// let gt = Arr(n, (i, a) => i == 0 ? 1n : a[i - 1] * BigInt(i) % MOD);
// let rgt = Arr(n, (i, a) => i <= 1 ? 1n : MOD - MOD / BigInt(i) * a[998244353 % i] % MOD);
// for (let i = 2; i < n; i++) rgt[i] = rgt[i] * rgt[i - 1] % MOD;
// let nCk = (n, k) => gt[n] * rgt[k] * rgt[n - k] % MOD;
// for (let i = dm[l.l]; i <= n + n; i += i & -i) s[i]++; // start from index 1

// let p = [2, 3, 5];
// for (let i = 6; i < 1e5; i += 6) {
//   let j, x = i + 1;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
//   x = i + 5;
//   for (j = 0; p[j] * p[j] <= x; j++) if (x % p[j] == 0) break;
//   if (x % p[j] != 0) p.push(x);
// }

let input = '';
process.stdin.on('data', c => input += c);
process.stdin.on('end', main);
function main() {
  let inp = input.split(/\s+/).map(v => +v), _i = 0, $ = n => n != null ? inp.slice(_i, _i += n) : inp[_i++],
    out = [], log = console.log, asc = (a, b) => a - b, desc = (a, b) => b - a, min = Math.min, max = Math.max, abs = Math.abs;
  let n = $(), k = $(), h = $(n);

  let m = {}, d = 0;
  h.sort(asc).forEach(v => m[v] ? 0 : m[v] = ++d);
  let n2 = 1 << Math.ceil(Math.log2(n));
  let it = Array(n2 * 2);
  For(1, n2 + n2 - 1, i => { it[i] = { max: 0, min: 1e10, c: 0 } })

  let update = i => {
    let l = it[i << 1], r = it[i << 1 | 1];
    it[i] = {
      max: max(l.max, r.max),
      min: min(l.min, r.min),
      c: l.c + r.c
    }
  }
  let set = (i, v, c) => {
    i = n2 + i - 1;
    it[i].c += c;
    if (it[i].c <= 0) { it[i].max = 0; it[i].min = 1e10 }
    else { it[i].max = v; it[i].min = v }
    while (i > 1) update(i >>= 1);
  }

  set(m[h[0]], h[0], 1);
  var maxRes = 1, i = j = 0;
  var allRes = [];
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      set(m[h[j]], h[j], 1);
      if (it[1].max - it[1].min > k) break;
    }
    if (maxRes < j - i) {
      maxRes = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (maxRes == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    set(m[h[i]], h[i++], -1);
    while (it[1].max - it[1].min > k) {
      set(m[h[i]], h[i++], -1);
    }
  }
  log(maxRes, allRes.length);
  log(allRes.join('\n'));
}

class Node {
  left; right; key; max; min;
  constructor(key) {
    this.key = key;
    this.max = key;
    this.min = key;
  }
  update() {
    if (this.left && this.right) {
      this.max = Math.max(this.key, this.left.max, this.right.max);
      this.min = Math.min(this.key, this.left.min, this.right.min);
    } else if (this.left) {
      this.max = Math.max(this.key, this.left.max);
      this.min = Math.min(this.key, this.left.min);
    } else if (this.right) {
      this.max = Math.max(this.key, this.right.max);
      this.min = Math.min(this.key, this.right.min);
    } else {
      this.max = this.key;
      this.min = this.key;
    }
  }
  toString() {
    return (this.left ? this.left.toString() + ' ' : '') + `(${this.key},${this.max},${this.min},${this.maxGap})` + (this.right ? ' ' + this.right.toString() : '')
  }
}

class SplayTree {
  root;
  constructor(node) {
    this.root = node;
  }

  uptree(x, p, g) {
    if (!g) {
      // lazy update p, x
      if (p.left == x) {
        p.left = x.right;
        x.right = p;
      } else {
        p.right = x.left;
        x.left = p;
      }
      p.update(); x.update();
      return x;
    }
    // lazy update g, p, x
    if (g.left == p && p.left == x) {
      g.left = p.right;
      p.right = g;
      p.left = x.right;
      x.right = p;
    } else if (g.right == p && p.right == x) {
      g.right = p.left;
      p.left = g;
      p.right = x.left;
      x.left = p;
    } else if (g.left == p) {
      p.right = x.left;
      x.left = p;
      g.left = x.right;
      x.right = g;
    } else {
      p.left = x.right;
      x.right = p;
      g.right = x.left;
      x.left = g;
    }
    g.update(); p.update(); x.update();
    return x;
  }

  splay(trace) {
    var x = trace.pop();
    while (true) {
      var p = trace.pop();
      var g = trace.pop();
      if (!p) return this.root = x;
      if (!g || !trace.length) return this.root = this.uptree(x, p, g);
      if (trace[trace.length - 1].left == g) trace[trace.length - 1].left = x = this.uptree(x, p, g);
      else trace[trace.length - 1].right = x = this.uptree(x, p, g);
    }
  }

  insert(key) {
    if (!this.root) return this.root = new Node(key);
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      cur = key < cur.key ? cur.left : cur.right;
    }
    cur = trace[trace.length - 1];
    if (key < cur.key) trace.push(cur.left = new Node(key));
    else trace.push(cur.right = new Node(key));
    this.splay(trace);
  }

  join(tree) {
    if (!this.root) return this.root = tree.root;
    var trace = [this.root];
    var cur = this.root;
    while (cur.right) trace.push(cur = cur.right);
    this.splay(trace);
    this.root.right = tree.root;
    this.root.update();
  }

  remove(key) {
    if (!this.root) return;
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      if (cur.key == key) break;
      cur = key < cur.key ? cur.left : cur.right;
    }
    if (trace[trace.length - 1].key != key) return;
    this.splay(trace);
    var tree = new SplayTree(this.root.right);
    this.root = this.root.left;
    this.join(tree);
  }

  load(nodes) {
    if (!nodes.length) return;
    this.root = nodes[0];
    let s = 1, k = 1;
    while (s < nodes.length) {
      let end = Math.min(s + k, nodes.length - 1);
      for (let i = end - 1; i >= s; i--) {
        nodes[i].right = nodes[i + 1];
        nodes[i].update();
      }
      this.root = nodes[s];
      this.root.left = nodes[s - k];
      this.root.update()
      s += ++k;
    }
  }

  max() {
    return this.root ? this.root.max : 0;
  }

  min() {
    return this.root ? this.root.min : 0;
  }

  print() {
    console.log(this.root ? this.root.toString() : undefined);
  }
}

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var _a, _b, _c, _d;
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var t = new BSTree();
    t.insert(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            t.insert(h[j]);
            // console.log(i, j, hk, t.print());
            if ((((_a = t.at(j - i)) === null || _a === void 0 ? void 0 : _a.key) || 0) - (((_b = t.at(0)) === null || _b === void 0 ? void 0 : _b.key) || 0) > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        // console.log(t.print(), i, j, h[i])
        t.remove(h[i++]);
        while (t.root && (((_c = t.at(j - i)) === null || _c === void 0 ? void 0 : _c.key) || 0) - (((_d = t.at(0)) === null || _d === void 0 ? void 0 : _d.key) || 0) > k) {
            // console.log('NOOO', i, j, h[i]);
            t.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - time)
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class SPnode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        let parent = this.parent;
        let grand = parent.parent;
        this.parent = grand;
        if (grand) {
            if (grand.left == parent)
                grand.left = this;
            else
                grand.right = this;
        }
        parent.parent = this;
        parent.left = this.right;
        if (this.right)
            this.right.parent = parent;
        this.right = parent;
        parent.update();
        this.update();
    }
    rotateLeft() {
        let parent = this.parent;
        let grand = parent.parent;
        this.parent = grand;
        if (grand) {
            if (grand.left == parent)
                grand.left = this;
            else
                grand.right = this;
        }
        parent.parent = this;
        parent.right = this.left;
        if (this.left)
            this.left.parent = parent;
        this.left = parent;
        parent.update();
        this.update();
    }
    splay() {
        while (true) {
            let parent = this.parent;
            if (!parent)
                return;
            let grand = parent.parent;
            if (!grand) {
                if (parent.left == this)
                    this.rotateRight();
                else
                    this.rotateLeft();
                return;
            }
            if (grand.left == parent && parent.left == this) {
                parent.rotateRight();
                this.rotateRight();
            }
            else if (grand.right == parent && parent.right == this) {
                parent.rotateLeft();
                this.rotateLeft();
            }
            else if (grand.left == parent) {
                this.rotateLeft();
                this.rotateRight();
            }
            else {
                this.rotateRight();
                this.rotateLeft();
            }
        }
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}
class BSNode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        var left = this.left;
        if (!left)
            return;
        this.left = left.right;
        left.right = this;
        this.update();
        left.update();
    }
    rotateLeft() {
        var right = this.right;
        if (!right)
            return;
        this.right = right.left;
        right.left = this;
        this.update();
        right.update();
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}
class BSTree {
    constructor(root) {
        this.root = root;
    }
    at(index) {
        var node = this.root;
        while (node) {
            var sizeLeft = node.left ? node.left.size : 0;
            if (sizeLeft == index)
                return node;
            if (index < sizeLeft)
                node = node.left;
            else {
                node = node.right;
                index -= sizeLeft + 1;
            }
        }
        return undefined;
    }
    insert(key) {
        if (!this.root)
            return this.root = new BSNode(key);
        var parent = undefined;
        var node = this.root;
        while (true) {
            var left = node.left;
            var right = node.right;
            var sizeLeft = left ? left.size : 0;
            var sizeRight = right ? right.size : 0;
            var sizeLeftLeft = left && left.left ? left.left.size : 0;
            var sizeLeftRight = left && left.right ? left.right.size : 0;
            var sizeRightLeft = right && right.left ? right.left.size : 0;
            var sizeRightRight = right && right.right ? right.right.size : 0;
            var dif = Math.abs(sizeLeft - sizeRight);
            if (Math.abs(1 + sizeRight + sizeLeftRight - sizeLeftLeft) < dif) {
                node.rotateRight();
                if (!parent)
                    this.root = left;
                else {
                    if (parent.left == node)
                        parent.left = left;
                    else
                        parent.right = left;
                }
                node = left;
                continue;
            }
            if (Math.abs(1 + sizeLeft + sizeRightLeft - sizeRightRight) < dif) {
                node.rotateLeft();
                if (!parent)
                    this.root = right;
                else {
                    if (parent.left == node)
                        parent.left = right;
                    else
                        parent.right = right;
                }
                node = right;
                continue;
            }
            if (key < node.key) {
                node.size++;
                if (!left)
                    return node.left = new BSNode(key);
                node = left;
            }
            else {
                node.size++;
                if (!right)
                    return node.right = new BSNode(key);
                node = right;
            }
        }
    }
    remove(key) {
        var parent = undefined;
        var node = this.root;
        while (node && node.key != key) {
            parent = node;
            node.size--;
            if (key < node.key)
                node = node.left;
            else
                node = node.right;
        }
        if (!node)
            return;
        var right = node.right;
        if (!right) {
            if (!parent) {
                this.root = node.left;
            }
            else {
                if (parent.left == node)
                    parent.left = node.left;
                else
                    parent.right = node.left;
            }
            return;
        }
        var rightParent = node;
        while (right && right.left) {
            rightParent = right;
            right.size--;
            right = right.left;
        }
        node.key = right.key;
        if (rightParent.left == right)
            rightParent.left = right.right;
        else
            rightParent.right = right.right;
        node.size--;
    }
    print() {
        console.log(this.root ? this.root.print() : undefined);
    }
}

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var t = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var tree = new SplayTree();
    tree.insert(h[0]);
    var max = 1;
    var allRes = ['1 1'];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            tree.insert(h[j]);
            if (tree.max() - tree.min() > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        max = Math.max(j - i, max);
        tree.remove(h[i++]);
        while (tree.max() - tree.min() > k) {
            tree.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - t)
})();
var SplayTree = eval(`
(function () {
  var Node = /** @class */ (function () {
    function Node(key, data) {
      this.next = null;
      this.key = key;
      this.data = data;
      this.left = null;
      this.right = null;
    }
    return Node;
  }());

  /* follows "An implementation of top-down splaying"
   * by D. Sleator <sleator@cs.cmu.edu> March 1992
   */
  function DEFAULT_COMPARE(a, b) {
    return a > b ? 1 : a < b ? -1 : 0;
  }
  /**
   * Simple top down splay, not requiring i to be in the tree t.
   */
  function splay(i, t, comparator) {
    var N = new Node(null, null);
    var l = N;
    var r = N;
    while (true) {
      var cmp = comparator(i, t.key);
      //if (i < t.key) {
      if (cmp < 0) {
        if (t.left === null)
          break;
        //if (i < t.left.key) {
        if (comparator(i, t.left.key) < 0) {
          var y = t.left; /* rotate right */
          t.left = y.right;
          y.right = t;
          t = y;
          if (t.left === null)
            break;
        }
        r.left = t; /* link right */
        r = t;
        t = t.left;
        //} else if (i > t.key) {
      }
      else if (cmp > 0) {
        if (t.right === null)
          break;
        //if (i > t.right.key) {
        if (comparator(i, t.right.key) > 0) {
          var y = t.right; /* rotate left */
          t.right = y.left;
          y.left = t;
          t = y;
          if (t.right === null)
            break;
        }
        l.right = t; /* link left */
        l = t;
        t = t.right;
      }
      else
        break;
    }
    /* assemble */
    l.right = t.left;
    r.left = t.right;
    t.left = N.right;
    t.right = N.left;
    return t;
  }
  function insert(i, data, t, comparator) {
    var node = new Node(i, data);
    if (t === null) {
      node.left = node.right = null;
      return node;
    }
    t = splay(i, t, comparator);
    var cmp = comparator(i, t.key);
    if (cmp < 0) {
      node.left = t.left;
      node.right = t;
      t.left = null;
    }
    else if (cmp >= 0) {
      node.right = t.right;
      node.left = t;
      t.right = null;
    }
    return node;
  }
  function split(key, v, comparator) {
    var left = null;
    var right = null;
    if (v) {
      v = splay(key, v, comparator);
      var cmp = comparator(v.key, key);
      if (cmp === 0) {
        left = v.left;
        right = v.right;
      }
      else if (cmp < 0) {
        right = v.right;
        v.right = null;
        left = v;
      }
      else {
        left = v.left;
        v.left = null;
        right = v;
      }
    }
    return { left: left, right: right };
  }
  function merge(left, right, comparator) {
    if (right === null)
      return left;
    if (left === null)
      return right;
    right = splay(left.key, right, comparator);
    right.left = left;
    return right;
  }
  var Tree = /** @class */ (function () {
    function Tree(comparator) {
      if (comparator === void 0) { comparator = DEFAULT_COMPARE; }
      this._root = null;
      this._size = 0;
      this._comparator = comparator;
    }
    /**
     * Inserts a key, allows duplicates
     */
    Tree.prototype.insert = function (key, data) {
      this._size++;
      return this._root = insert(key, data, this._root, this._comparator);
    };
    /**
     * Adds a key, if it is not present in the tree
     */
    Tree.prototype.add = function (key, data) {
      var node = new Node(key, data);
      if (this._root === null) {
        node.left = node.right = null;
        this._size++;
        this._root = node;
      }
      var comparator = this._comparator;
      var t = splay(key, this._root, comparator);
      var cmp = comparator(key, t.key);
      if (cmp === 0)
        this._root = t;
      else {
        if (cmp < 0) {
          node.left = t.left;
          node.right = t;
          t.left = null;
        }
        else if (cmp > 0) {
          node.right = t.right;
          node.left = t;
          t.right = null;
        }
        this._size++;
        this._root = node;
      }
      return this._root;
    };
    /**
     * @param  {Key} key
     * @return {Node|null}
     */
    Tree.prototype.remove = function (key) {
      this._root = this._remove(key, this._root, this._comparator);
    };
    /**
     * Deletes i from the tree if it's there
     */
    Tree.prototype._remove = function (i, t, comparator) {
      var x;
      if (t === null)
        return null;
      t = splay(i, t, comparator);
      var cmp = comparator(i, t.key);
      if (cmp === 0) { /* found it */
        if (t.left === null) {
          x = t.right;
        }
        else {
          x = splay(i, t.left, comparator);
          x.right = t.right;
        }
        this._size--;
        return x;
      }
      return t; /* It wasn't there */
    };
    /**
     * Removes and returns the node with smallest key
     */
    Tree.prototype.pop = function () {
      var node = this._root;
      if (node) {
        while (node.left)
          node = node.left;
        this._root = splay(node.key, this._root, this._comparator);
        this._root = this._remove(node.key, this._root, this._comparator);
        return { key: node.key, data: node.data };
      }
      return null;
    };
    /**
     * Find without splaying
     */
    Tree.prototype.findStatic = function (key) {
      var current = this._root;
      var compare = this._comparator;
      while (current) {
        var cmp = compare(key, current.key);
        if (cmp === 0)
          return current;
        else if (cmp < 0)
          current = current.left;
        else
          current = current.right;
      }
      return null;
    };
    Tree.prototype.find = function (key) {
      if (this._root) {
        this._root = splay(key, this._root, this._comparator);
        if (this._comparator(key, this._root.key) !== 0)
          return null;
      }
      return this._root;
    };
    Tree.prototype.contains = function (key) {
      var current = this._root;
      var compare = this._comparator;
      while (current) {
        var cmp = compare(key, current.key);
        if (cmp === 0)
          return true;
        else if (cmp < 0)
          current = current.left;
        else
          current = current.right;
      }
      return false;
    };
    Tree.prototype.forEach = function (visitor, ctx) {
      var current = this._root;
      var Q = []; /* Initialize stack s */
      var done = false;
      while (!done) {
        if (current !== null) {
          Q.push(current);
          current = current.left;
        }
        else {
          if (Q.length !== 0) {
            current = Q.pop();
            visitor.call(ctx, current);
            current = current.right;
          }
          else
            done = true;
        }
      }
      return this;
    };

    Tree.prototype.range = function (low, high, fn, ctx) {
      var Q = [];
      var compare = this._comparator;
      var node = this._root;
      var cmp;
      while (Q.length !== 0 || node) {
        if (node) {
          Q.push(node);
          node = node.left;
        }
        else {
          node = Q.pop();
          cmp = compare(node.key, high);
          if (cmp > 0) {
            break;
          }
          else if (compare(node.key, low) >= 0) {
            if (fn.call(ctx, node))
              return this; // stop if smth is returned
          }
          node = node.right;
        }
      }
      return this;
    };
    /**
     * Returns array of keys
     */
    Tree.prototype.keys = function () {
      var keys = [];
      this.forEach(function (_a) {
        var key = _a.key;
        return keys.push(key);
      });
      return keys;
    };
    /**
     * Returns array of all the data in the nodes
     */
    Tree.prototype.values = function () {
      var values = [];
      this.forEach(function (_a) {
        var data = _a.data;
        return values.push(data);
      });
      return values;
    };
    Tree.prototype.min = function () {
      if (this._root)
        return this.minNode(this._root).key;
      return null;
    };
    Tree.prototype.max = function () {
      if (this._root)
        return this.maxNode(this._root).key;
      return null;
    };
    Tree.prototype.minNode = function (t) {
      if (t === void 0) { t = this._root; }
      if (t)
        while (t.left)
          t = t.left;
      return t;
    };
    Tree.prototype.maxNode = function (t) {
      if (t === void 0) { t = this._root; }
      if (t)
        while (t.right)
          t = t.right;
      return t;
    };
    /**
     * Returns node at given index
     */
    Tree.prototype.at = function (index) {
      var current = this._root;
      var done = false;
      var i = 0;
      var Q = [];
      while (!done) {
        if (current) {
          Q.push(current);
          current = current.left;
        }
        else {
          if (Q.length > 0) {
            current = Q.pop();
            if (i === index)
              return current;
            i++;
            current = current.right;
          }
          else
            done = true;
        }
      }
      return null;
    };
    Tree.prototype.next = function (d) {
      var root = this._root;
      var successor = null;
      if (d.right) {
        successor = d.right;
        while (successor.left)
          successor = successor.left;
        return successor;
      }
      var comparator = this._comparator;
      while (root) {
        var cmp = comparator(d.key, root.key);
        if (cmp === 0)
          break;
        else if (cmp < 0) {
          successor = root;
          root = root.left;
        }
        else
          root = root.right;
      }
      return successor;
    };
    Tree.prototype.prev = function (d) {
      var root = this._root;
      var predecessor = null;
      if (d.left !== null) {
        predecessor = d.left;
        while (predecessor.right)
          predecessor = predecessor.right;
        return predecessor;
      }
      var comparator = this._comparator;
      while (root) {
        var cmp = comparator(d.key, root.key);
        if (cmp === 0)
          break;
        else if (cmp < 0)
          root = root.left;
        else {
          predecessor = root;
          root = root.right;
        }
      }
      return predecessor;
    };
    Tree.prototype.clear = function () {
      this._root = null;
      this._size = 0;
      return this;
    };
    Tree.prototype.toList = function () {
      return toList(this._root);
    };
    /**
     * Bulk-load items. Both array have to be same size
     */
    Tree.prototype.load = function (keys, values, presort) {
      if (values === void 0) { values = []; }
      if (presort === void 0) { presort = false; }
      var size = keys.length;
      var comparator = this._comparator;
      // sort if needed
      if (presort)
        sort(keys, values, 0, size - 1, comparator);
      if (this._root === null) { // empty tree
        this._root = loadRecursive(keys, values, 0, size);
        this._size = size;
      }
      else { // that re-builds the whole tree from two in-order traversals
        var mergedList = mergeLists(this.toList(), createList(keys, values), comparator);
        size = this._size + size;
        this._root = sortedListToBST({ head: mergedList }, 0, size);
      }
      return this;
    };
    Tree.prototype.isEmpty = function () { return this._root === null; };
    Object.defineProperty(Tree.prototype, "size", {
      get: function () { return this._size; },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(Tree.prototype, "root", {
      get: function () { return this._root; },
      enumerable: true,
      configurable: true
    });
    Tree.prototype.toString = function (printNode) {
      if (printNode === void 0) { printNode = function (n) { return String(n.key); }; }
      var out = [];
      printRow(this._root, '', true, function (v) { return out.push(v); }, printNode);
      return out.join('');
    };
    Tree.prototype.update = function (key, newKey, newData) {
      var comparator = this._comparator;
      var _a = split(key, this._root, comparator), left = _a.left, right = _a.right;
      if (comparator(key, newKey) < 0) {
        right = insert(newKey, newData, right, comparator);
      }
      else {
        left = insert(newKey, newData, left, comparator);
      }
      this._root = merge(left, right, comparator);
    };
    Tree.prototype.split = function (key) {
      return split(key, this._root, this._comparator);
    };
    return Tree;
  }());
  function loadRecursive(keys, values, start, end) {
    var size = end - start;
    if (size > 0) {
      var middle = start + Math.floor(size / 2);
      var key = keys[middle];
      var data = values[middle];
      var node = new Node(key, data);
      node.left = loadRecursive(keys, values, start, middle);
      node.right = loadRecursive(keys, values, middle + 1, end);
      return node;
    }
    return null;
  }
  function createList(keys, values) {
    var head = new Node(null, null);
    var p = head;
    for (var i = 0; i < keys.length; i++) {
      p = p.next = new Node(keys[i], values[i]);
    }
    p.next = null;
    return head.next;
  }
  function toList(root) {
    var current = root;
    var Q = [];
    var done = false;
    var head = new Node(null, null);
    var p = head;
    while (!done) {
      if (current) {
        Q.push(current);
        current = current.left;
      }
      else {
        if (Q.length > 0) {
          current = p = p.next = Q.pop();
          current = current.right;
        }
        else
          done = true;
      }
    }
    p.next = null; // that'll work even if the tree was empty
    return head.next;
  }
  function sortedListToBST(list, start, end) {
    var size = end - start;
    if (size > 0) {
      var middle = start + Math.floor(size / 2);
      var left = sortedListToBST(list, start, middle);
      var root = list.head;
      root.left = left;
      list.head = list.head.next;
      root.right = sortedListToBST(list, middle + 1, end);
      return root;
    }
    return null;
  }
  function mergeLists(l1, l2, compare) {
    var head = new Node(null, null); // dummy
    var p = head;
    var p1 = l1;
    var p2 = l2;
    while (p1 !== null && p2 !== null) {
      if (compare(p1.key, p2.key) < 0) {
        p.next = p1;
        p1 = p1.next;
      }
      else {
        p.next = p2;
        p2 = p2.next;
      }
      p = p.next;
    }
    if (p1 !== null) {
      p.next = p1;
    }
    else if (p2 !== null) {
      p.next = p2;
    }
    return head.next;
  }
  function sort(keys, values, left, right, compare) {
    if (left >= right)
      return;
    var pivot = keys[(left + right) >> 1];
    var i = left - 1;
    var j = right + 1;
    while (true) {
      do
        i++;
      while (compare(keys[i], pivot) < 0);
      do
        j--;
      while (compare(keys[j], pivot) > 0);
      if (i >= j)
        break;
      var tmp = keys[i];
      keys[i] = keys[j];
      keys[j] = tmp;
      tmp = values[i];
      values[i] = values[j];
      values[j] = tmp;
    }
    sort(keys, values, left, j, compare);
    sort(keys, values, j + 1, right, compare);
  }

  return Tree;

})();
`);

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var t = new SPnode(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0, hk = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            t = t.insert(h[j]);
            hk = (t = t.at(j - i)).key - (t = t.at(0)).key;
            // console.log(i, j, hk, t.print());
            if (hk > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        // console.log(t.print(), i, j, h[i])
        t = t.remove(h[i++]);
        while (t && (t = t.at(j - i)).key - (t = t.at(0)).key > k) {
            // console.log('NOOO', i, j, h[i]);
            t = t.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    console.log(Date.now() - time);
})();
class SPnode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        let parent = this.parent;
        let grand = parent.parent;
        this.parent = grand;
        if (grand) {
            if (grand.left == parent)
                grand.left = this;
            else
                grand.right = this;
        }
        parent.parent = this;
        parent.left = this.right;
        if (this.right)
            this.right.parent = parent;
        this.right = parent;
        parent.update();
        this.update();
    }
    rotateLeft() {
        let parent = this.parent;
        let grand = parent.parent;
        this.parent = grand;
        if (grand) {
            if (grand.left == parent)
                grand.left = this;
            else
                grand.right = this;
        }
        parent.parent = this;
        parent.right = this.left;
        if (this.left)
            this.left.parent = parent;
        this.left = parent;
        parent.update();
        this.update();
    }
    splay() {
        while (true) {
            let parent = this.parent;
            if (!parent)
                return;
            let grand = parent.parent;
            if (!grand) {
                if (parent.left == this)
                    this.rotateRight();
                else
                    this.rotateLeft();
                return;
            }
            if (grand.left == parent && parent.left == this) {
                parent.rotateRight();
                this.rotateRight();
            }
            else if (grand.right == parent && parent.right == this) {
                parent.rotateLeft();
                this.rotateLeft();
            }
            else if (grand.left == parent) {
                this.rotateLeft();
                this.rotateRight();
            }
            else {
                this.rotateRight();
                this.rotateLeft();
            }
        }
    }
    join(nodeRight) {
        var node = this;
        while (node.right)
            node = node.right;
        node.splay();
        node.right = nodeRight;
        if (nodeRight)
            nodeRight.parent = node;
        node.update();
        return node;
    }
    split() {
        var rightNode = this.right;
        if (rightNode)
            rightNode.parent = undefined;
        this.right = undefined;
        this.update();
        return [this, rightNode];
    }
    at(index, splay = false) {
        var node = this;
        while (node) {
            var sizeLeft = node.left ? node.left.size : 0;
            if (sizeLeft == index) {
                if (splay)
                    node.splay();
                return node;
            }
            if (index < sizeLeft)
                node = node.left;
            else {
                node = node.right;
                index -= sizeLeft + 1;
            }
        }
        return this;
    }
    insert(key) {
        var node = this;
        while (true) {
            if (key < node.key) {
                if (node.left)
                    node = node.left;
                else {
                    let newNode = new SPnode(key);
                    newNode.parent = node;
                    node.left = newNode;
                    newNode.splay();
                    return newNode;
                }
            }
            else {
                if (node.right)
                    node = node.right;
                else {
                    let newNode = new SPnode(key);
                    newNode.parent = node;
                    node.right = newNode;
                    newNode.splay();
                    return newNode;
                }
            }
        }
    }
    remove(key) {
        var node = this;
        while (node && node.key != key) {
            if (key < node.key)
                node = node.left;
            else
                node = node.right;
        }
        if (!node)
            return this;
        node.splay();
        var nodeLeft = node.left;
        var nodeRight = node.right;
        if (nodeLeft)
            nodeLeft.parent = undefined;
        if (nodeRight)
            nodeRight.parent = undefined;
        if (!nodeLeft)
            return nodeRight;
        return nodeLeft.join(nodeRight);
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => ({ key: +v }));
    var hmin = new Heap(n + 1);
    var hmax = new Heap(n + 1, (a, b) => b - a, 'idMax');
    hmin.push(h[0]);
    hmax.push(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (j >= n)
                break;
            hmin.push(h[j]);
            hmax.push(h[j]);
            if (hmax.h[0].key - hmin.h[0].key > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        hmin.pop(h[i].idMin);
        hmax.pop(h[i].idMax);
        i++;
        while (hmax.size && hmax.h[0].key - hmin.h[0].key > k) {
            // console.log('NOOO', i, j, h[i]);
            hmin.pop(h[i].idMin);
            hmax.pop(h[i].idMax);
            i++;
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class Heap {
    constructor(MAX_LENGTH = 100000, comp = (a, b) => a - b, id = 'idMin') {
        this.h = Array(MAX_LENGTH);
        this.size = 0;
        this.comp = comp;
        this.id = id;
    }
    push(node) {
        this.h[this.size] = node;
        node[this.id] = this.size;
        this.size++;
        while (true) {
            if (node[this.id] == 0)
                break;
            var parentId = (node[this.id] - 1) >> 1;
            if (this.comp(this.h[parentId].key, node.key) > 0) {
                this.h[node[this.id]] = this.h[parentId];
                this.h[node[this.id]][this.id] = node[this.id];
                this.h[parentId] = node;
                node[this.id] = parentId;
            }
            else
                break;
        }
    }
    pop(id = 0) {
        var popNode = this.h[id];
        this.size--;
        this.h[id] = this.h[this.size];
        this.h[id][this.id] = id;
        var node = this.h[id];
        while (true) {
            var childId = node[this.id] * 2 + 1;
            if (childId > this.size)
                break;
            if (childId < this.size && this.comp(this.h[childId].key, this.h[childId + 1].key) > 0)
                childId++;
            if (this.comp(this.h[childId].key, node.key) > 0)
                break;
            this.h[node[this.id]] = this.h[childId];
            this.h[node[this.id]][this.id] = node[this.id];
            this.h[childId] = node;
            node[this.id] = childId;
        }
        while (true) {
            if (node[this.id] == 0)
                break;
            var parentId = (node[this.id] - 1) >> 1;
            if (this.comp(this.h[parentId].key, node.key) > 0) {
                this.h[node[this.id]] = this.h[parentId];
                this.h[node[this.id]][this.id] = node[this.id];
                this.h[parentId] = node;
                node[this.id] = parentId;
            }
            else
                break;
        }
        return popNode;
    }
}

class Node {
  left; right; key; min; max;
  constructor(key) {
    this.key = key;
    this.min = key;
    this.max = key;
  }
  update() {
    this.min = Math.min(this.key, this.left ? this.left.key : 1e10, this.right ? this.right.key : 1e10);
    this.max = Math.max(this.key, this.left ? this.left.key : -1e10, this.right ? this.right.key : -1e10);
  }
}

class SplayTree {
  root;
  constructor(node) {
    this.root = node;
  }

  uptree(x, p, g) {
    if (!g) {
      if (p.left == x) {
        p.left = x.right;
        x.right = p;
      } else {
        p.right = x.left;
        x.left = p;
      }
      p.update(); x.update();
      return x;
    }
    if (g.left == p && p.left == x) {
      g.left = p.right;
      p.right = g;
      p.left = x.right;
      x.right = p;
    } else if (g.right == p && p.right == x) {
      g.right = p.left;
      p.left = g;
      p.right = x.left;
      x.left = p;
    } else if (g.left == p) {
      p.right = x.left;
      x.left = p;
      g.left = x.right;
      x.right = g;
    } else {
      p.left = x.right;
      x.right = p;
      g.right = x.left;
      x.left = g;
    }
    g.update(); p.update(); x.update();
    return x;
  }

  splay(trace) {
    var x = trace.pop();
    while (true) {
      var p = trace.pop();
      var g = trace.pop();
      if (!p) return this.root = x;
      if (!g || !trace.length) return this.root = this.uptree(x, p, g);
      if (trace[trace.length - 1].left == g) trace[trace.length - 1].left = x = this.uptree(x, p, g);
      else trace[trace.length - 1].right = x = this.uptree(x, p, g);
    }
  }

  insert(key) {
    if (!this.root) return this.root = new Node(key);
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      cur = key < cur.key ? cur.left : cur.right;
    }
    cur = trace[trace.length - 1];
    if (key < cur.key) trace.push[cur.left = new Node(key)];
    else trace.push[cur.right = new Node(key)];
    this.splay(trace);
  }

  join(tree) {
    if (!this.root) return this.root = tree.root;
    var trace = [this.root];
    var cur = this.root;
    while (cur.right) trace.push(cur = cur.right);
    this.splay(trace);
    this.root.right = tree.root;
    this.root.update();
  }

  remove(key) {
    if (!this.root) return;
    var trace = [];
    var cur = this.root;
    while (cur) {
      trace.push(cur);
      if (cur.key == key) break;
      cur = key < cur.key ? cur.left : cur.right;
    }
    if (trace[trace.length - 1].key != key) return;
    this.splay(trace);
    var tree = new SplayTree(this.root.right);
    this.root = this.root.left;
    this.join(tree);
  }

  min() {
    return this.root ? this.root.min : undefined;
  }

  max() {
    return this.root ? this.root.max : undefined;
  }

  print() {
    console.log(this.root ? this.root.toString() : undefined);
  }
}

// var t = new SplayTree();
// var arr = Array(5).fill(0).map(v => Math.random() * 100 | 0);
// arr.forEach(v => {
//   t.insert(v);
//   t.print();
// });
// console.log('---');
// arr.forEach(v => {
//   t.remove(v);
//   t.print();
// })

var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
  inputResolve();
});
(async () => {
  await inputPromise;
  var inp = input.split(/\D+/m).map(v => +v), r = 0;
  var n = inp[r++], k = inp[r++];
  var h = inp.slice(r, r = r + n);
  var t = new SplayTree();
  t.insert(h[0]);
  var max = 1, i = j = 0;
  var allRes = [];
  // console.log(n,k,h);
  while (i < n) {
    while (j < n) {
      j++;
      if (j >= n) break;
      t.insert(h[j]);
      if (t.max() - t.min() > k) break;
    }
    if (max < j - i) {
      max = j - i;
      allRes = [(i + 1) + ' ' + j];
    }
    else if (max == j - i) {
      allRes.push((i + 1) + ' ' + j);
    }
    t.remove(h[i++]);
    while (t.max() - t.min() > k) {
      t.remove(h[i++]);
    }
  }
  console.log(max, allRes.length);
  console.log(allRes.join('\n'));
})();

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var tree = { value: h[0], size: 1 };
    var max = 1;
    var j = 0, hmax, hmin;
    for (let i = 0; i < n; i++) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            tree = insertValue(tree, h[j]);
            hmin = find(tree, 0).value;
            hmax = find(tree, j - i).value;
            // console.log(i, j, hmin, hmax);
            if (hmax - hmin > k)
                break;
        }
        max = Math.max(j - i, max);
        tree = deleteValue(tree, h[i]);
    }
    var allRes = [];
    tree = null;
    for (let i = 0; i < n; i++) {
        tree = insertValue(tree, h[i]);
        if (i >= max - 1) {
            hmin = find(tree, 0).value;
            hmax = find(tree, max - 1).value;
            if (hmax - hmin <= k)
                allRes.push((i - max + 2) + ' ' + (i + 1));
            tree = deleteValue(tree, h[i - max + 1]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
})();
function setlink(parent, child, right) {
    if (right)
        (parent || {}).right = child;
    else
        (parent || {}).left = child;
    (child || {}).parent = parent;
}
function update(x) {
    var _a, _b;
    x.size = (((_a = x.left) === null || _a === void 0 ? void 0 : _a.size) || 0) + (((_b = x.right) === null || _b === void 0 ? void 0 : _b.size) || 0) + 1;
    // x.max = Math.max(x.value, x.left?.value, x.right?.value);
}
function uptree(x) {
    let parent = x.parent;
    let grand = parent === null || parent === void 0 ? void 0 : parent.parent;
    if (x == (parent === null || parent === void 0 ? void 0 : parent.left)) {
        setlink(parent, x.right, false);
        setlink(x, parent, true);
    }
    else {
        setlink(parent, x.left, true);
        setlink(x, parent, false);
    }
    setlink(grand, x, parent == (grand === null || grand === void 0 ? void 0 : grand.right));
    update(parent);
    update(x);
}
function splay(x) {
    while (true) {
        let parent = x.parent;
        if (!parent)
            break;
        let grand = parent.parent;
        if (grand) {
            if ((parent == grand.left) == (x == parent.left))
                uptree(parent);
            else
                uptree(x);
        }
        uptree(x);
    }
    return x;
}
function find(tree, index) {
    var _a;
    while (true) {
        if (!tree)
            return tree;
        let curIndex = ((_a = tree.left) === null || _a === void 0 ? void 0 : _a.size) || 0;
        if (curIndex == index)
            return tree;
        if (curIndex > index)
            tree = tree.left;
        else {
            index -= curIndex + 1;
            tree = tree.right;
        }
    }
}
function cut(tree, index) {
    if (!tree)
        return [tree, tree];
    let treeA, treeB;
    if (index <= 0) {
        treeB = tree;
        return [treeA, treeB];
    }
    if (index >= tree.size) {
        treeA = tree;
        return [treeA, treeB];
    }
    let x = find(tree, index);
    splay(x);
    treeB = x.right;
    treeB === null || treeB === void 0 ? true : delete treeB.parent;
    treeA = x;
    treeA === null || treeA === void 0 ? true : delete treeA.right;
    update(treeA);
    return [treeA, treeB];
}
function join(treeA, treeB) {
    if (!treeA)
        return treeB;
    if (!treeB)
        return treeA;
    while (treeA.right)
        treeA = treeA.right;
    splay(treeA);
    setlink(treeA, treeB, true);
    update(treeA);
    return treeA;
}
function insertNode(tree, index, value) {
    let x = { value, size: 1 };
    let [treeA, treeB] = cut(tree, index);
    return join(join(treeA, x), treeB);
}
function deleteNode(tree, index) {
    let x = find(tree, index);
    if (!x)
        return tree;
    splay(x);
    let treeA = x.left, treeB = x.right;
    (treeA || {}).parent = null;
    (treeB || {}).parent = null;
    return join(treeA, treeB);
}
function findValue(tree, value) {
    if (!tree)
        return tree;
    while (true) {
        if (value < tree.value && tree.left)
            tree = tree.left;
        else if (value > tree.value && tree.right)
            tree = tree.right;
        else
            return splay(tree);
    }
}
function insertValue(tree, value) {
    var _a, _b;
    tree = findValue(tree, value);
    if (value < (tree === null || tree === void 0 ? void 0 : tree.value))
        tree = insertNode(tree, ((_a = tree === null || tree === void 0 ? void 0 : tree.left) === null || _a === void 0 ? void 0 : _a.size) || 0, value);
    else
        tree = insertNode(tree, (((_b = tree === null || tree === void 0 ? void 0 : tree.left) === null || _b === void 0 ? void 0 : _b.size) || 0) + 1, value);
    return tree;
}
function deleteValue(tree, value) {
    var _a;
    tree = findValue(tree, value);
    return deleteNode(tree, ((_a = tree.left) === null || _a === void 0 ? void 0 : _a.size) || 0);
}

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var _a, _b;
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var tree = { value: h[0], size: 1 };
    var max = 1;
    var i = 0, j = 0, hmax, hmin;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            tree = insertValue(tree, h[j]);
            hmin = find(tree, 0).value;
            hmax = find(tree, j - i).value;
            // console.log(i, j, hmin, hmax);
            if (hmax - hmin > k)
                break;
        }
        max = Math.max(j - i, max);
        tree = deleteValue(tree, h[i++]);
        while (((_a = find(tree, j - i)) === null || _a === void 0 ? void 0 : _a.value) - ((_b = find(tree, 0)) === null || _b === void 0 ? void 0 : _b.value) > k) {
            tree = deleteValue(tree, h[i++]);
        }
    }
    var allRes = [];
    tree = null;
    for (let i = 0; i < n; i++) {
        tree = insertValue(tree, h[i]);
        if (i >= max - 1) {
            hmin = find(tree, 0).value;
            hmax = find(tree, max - 1).value;
            if (hmax - hmin <= k)
                allRes.push((i - max + 2) + ' ' + (i + 1));
            tree = deleteValue(tree, h[i - max + 1]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
})();
function setlink(parent, child, right) {
    if (right)
        (parent || {}).right = child;
    else
        (parent || {}).left = child;
    (child || {}).parent = parent;
}
function update(x) {
    var _a, _b;
    x.size = (((_a = x.left) === null || _a === void 0 ? void 0 : _a.size) || 0) + (((_b = x.right) === null || _b === void 0 ? void 0 : _b.size) || 0) + 1;
    // x.max = Math.max(x.value, x.left?.value, x.right?.value);
}
function uptree(x) {
    let parent = x.parent;
    let grand = parent === null || parent === void 0 ? void 0 : parent.parent;
    if (x == (parent === null || parent === void 0 ? void 0 : parent.left)) {
        setlink(parent, x.right, false);
        setlink(x, parent, true);
    }
    else {
        setlink(parent, x.left, true);
        setlink(x, parent, false);
    }
    setlink(grand, x, parent == (grand === null || grand === void 0 ? void 0 : grand.right));
    update(parent);
    update(x);
}
function splay(x) {
    while (true) {
        let parent = x.parent;
        if (!parent)
            break;
        let grand = parent.parent;
        if (grand) {
            if ((parent == grand.left) == (x == parent.left))
                uptree(parent);
            else
                uptree(x);
        }
        uptree(x);
    }
    return x;
}
function find(tree, index) {
    var _a;
    while (true) {
        if (!tree)
            return tree;
        let curIndex = ((_a = tree.left) === null || _a === void 0 ? void 0 : _a.size) || 0;
        if (curIndex == index)
            return tree;
        if (curIndex > index)
            tree = tree.left;
        else {
            index -= curIndex + 1;
            tree = tree.right;
        }
    }
}
function cut(tree, index) {
    if (!tree)
        return [tree, tree];
    let treeA, treeB;
    if (index <= 0) {
        treeB = tree;
        return [treeA, treeB];
    }
    if (index >= tree.size) {
        treeA = tree;
        return [treeA, treeB];
    }
    let x = find(tree, index);
    splay(x);
    treeB = x.right;
    treeB === null || treeB === void 0 ? true : delete treeB.parent;
    treeA = x;
    treeA === null || treeA === void 0 ? true : delete treeA.right;
    update(treeA);
    return [treeA, treeB];
}
function join(treeA, treeB) {
    if (!treeA)
        return treeB;
    if (!treeB)
        return treeA;
    while (treeA.right)
        treeA = treeA.right;
    splay(treeA);
    setlink(treeA, treeB, true);
    update(treeA);
    return treeA;
}
function insertNode(tree, index, value) {
    let x = { value, size: 1 };
    let [treeA, treeB] = cut(tree, index);
    return join(join(treeA, x), treeB);
}
function deleteNode(tree, index) {
    let x = find(tree, index);
    if (!x)
        return tree;
    splay(x);
    let treeA = x.left, treeB = x.right;
    (treeA || {}).parent = null;
    (treeB || {}).parent = null;
    return join(treeA, treeB);
}
function findValue(tree, value) {
    if (!tree)
        return tree;
    while (true) {
        if (value < tree.value && tree.left)
            tree = tree.left;
        else if (value > tree.value && tree.right)
            tree = tree.right;
        else
            return splay(tree);
    }
}
function insertValue(tree, value) {
    var _a, _b;
    tree = findValue(tree, value);
    if (value < (tree === null || tree === void 0 ? void 0 : tree.value))
        tree = insertNode(tree, ((_a = tree === null || tree === void 0 ? void 0 : tree.left) === null || _a === void 0 ? void 0 : _a.size) || 0, value);
    else
        tree = insertNode(tree, (((_b = tree === null || tree === void 0 ? void 0 : tree.left) === null || _b === void 0 ? void 0 : _b.size) || 0) + 1, value);
    return tree;
}
function deleteValue(tree, value) {
    var _a;
    tree = findValue(tree, value);
    return deleteNode(tree, ((_a = tree.left) === null || _a === void 0 ? void 0 : _a.size) || 0);
}

"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var [n, k] = inputs[0].split(' ').map(v => +v);
    var h = inputs[1].split(' ').map(v => +v);
    var t = new BSTree();
    t.insert(h[0]);
    var max = 1;
    var i = 0, j = 0;
    var max = 1;
    var allRes = [];
    var i = 0, j = 0;
    while (i < n) {
        while (j < n) {
            j++;
            if (!h[j])
                break;
            t.insert(h[j]);
            // console.log(i, j, hk, t.print());
            if (t.key(j - i) - t.key(0) > k)
                break;
        }
        if (max < j - i) {
            max = j - i;
            allRes = [(i + 1) + ' ' + j];
        }
        else if (max == j - i) {
            allRes.push((i + 1) + ' ' + j);
        }
        // console.log(t.print(), i, j, h[i])
        t.remove(h[i++]);
        while (t.key(j - i) - t.key(0) > k) {
            // console.log('NOOO', i, j, h[i]);
            t.remove(h[i++]);
        }
    }
    console.log(max, allRes.length);
    console.log(allRes.join('\n'));
    // console.log(Date.now() - time)
})();
Object.defineProperty(Object.prototype, '$k', {
    value: function () { return Object.keys(this); }
});
Object.defineProperty(Object.prototype, '$v', {
    value: function () { return Object.values(this); }
});
Object.defineProperty(Object.prototype, '$kv', {
    value: function () { return Object.entries(this); }
});
Array.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), 0); };
Array.prototype.uniq = function (fn) {
    var set = new Set();
    return this.filter(v => {
        var newValue = !set.has(fn ? fn(v) : v);
        set.add(fn ? fn(v) : v);
        return newValue;
    });
};
Array.prototype.toObj = function (fn) {
    return this.map(v => fn(v)).reduce((p, v) => {
        p[v[0]] = v[1];
        return p;
    }, {});
};
class BSNode {
    constructor(key) {
        this.key = key;
        this.size = 1;
    }
    update() {
        this.size = 1 + (this.left ? this.left.size : 0) + (this.right ? this.right.size : 0);
    }
    rotateRight() {
        var left = this.left;
        if (!left)
            return;
        this.left = left.right;
        left.right = this;
        this.update();
        left.update();
    }
    rotateLeft() {
        var right = this.right;
        if (!right)
            return;
        this.right = right.left;
        right.left = this;
        this.update();
        right.update();
    }
    print() {
        if (this.left) {
            process.stdout.write("left ");
            this.left.print();
        }
        process.stdout.write(this.key + ',' + this.size + ' ');
        if (this.right) {
            process.stdout.write("right ");
            this.right.print();
        }
    }
}
class BSTree {
    constructor(root) {
        this.root = root;
    }
    at(index) {
        var node = this.root;
        while (node) {
            var sizeLeft = node.left ? node.left.size : 0;
            if (sizeLeft == index)
                return node;
            if (index < sizeLeft)
                node = node.left;
            else {
                node = node.right;
                index -= sizeLeft + 1;
            }
        }
        return undefined;
    }
    key(index) {
        var _a;
        return ((_a = this.at(index)) === null || _a === void 0 ? void 0 : _a.key) || 0;
    }
    insert(key) {
        if (!this.root)
            return this.root = new BSNode(key);
        var parent = undefined;
        var node = this.root;
        while (true) {
            var left = node.left;
            var right = node.right;
            var sizeLeft = left ? left.size : 0;
            var sizeRight = right ? right.size : 0;
            var sizeLeftLeft = left && left.left ? left.left.size : 0;
            var sizeLeftRight = left && left.right ? left.right.size : 0;
            var sizeRightLeft = right && right.left ? right.left.size : 0;
            var sizeRightRight = right && right.right ? right.right.size : 0;
            var dif = Math.abs(sizeLeft - sizeRight);
            if (Math.abs(1 + sizeRight + sizeLeftRight - sizeLeftLeft) < dif) {
                if (key == 7)
                    console.log('rotateRight', node.key);
                node.rotateRight();
                if (!parent)
                    this.root = left;
                else {
                    if (parent.left == node)
                        parent.left = left;
                    else
                        parent.right = left;
                }
                node = left;
                continue;
            }
            if (Math.abs(1 + sizeLeft + sizeRightLeft - sizeRightRight) < dif) {
                node.rotateLeft();
                if (!parent)
                    this.root = right;
                else {
                    if (parent.left == node)
                        parent.left = right;
                    else
                        parent.right = right;
                }
                node = right;
                continue;
            }
            if (key < node.key) {
                node.size++;
                if (!left)
                    return node.left = new BSNode(key);
                parent = node;
                node = left;
            }
            else {
                node.size++;
                if (!right)
                    return node.right = new BSNode(key);
                parent = node;
                node = right;
            }
        }
    }
    remove(key) {
        var parent = undefined;
        var node = this.root;
        while (node && node.key != key) {
            parent = node;
            node.size--;
            if (key < node.key)
                node = node.left;
            else
                node = node.right;
        }
        if (!node)
            return;
        var right = node.right;
        if (!right) {
            if (!parent) {
                this.root = node.left;
            }
            else {
                if (parent.left == node)
                    parent.left = node.left;
                else
                    parent.right = node.left;
            }
            return;
        }
        var rightParent = node;
        while (right && right.left) {
            rightParent = right;
            right.size--;
            right = right.left;
        }
        node.key = right.key;
        if (rightParent.left == right)
            rightParent.left = right.right;
        else
            rightParent.right = right.right;
        node.size--;
    }
    print() {
        console.log(this.root ? this.root.print() : undefined);
    }
}