#include <bits/stdc++.h>
struct Input {
  int maxDifference;
  std::vector<int> heights;
};
struct Output {
  int length;
  std::vector<int> lo;
  Output() : length(INT_MIN), lo(std::vector<int>()) {}
};
void runTest();
Input parseInput();
Output computeResult(const Input& in);
void printOutput(const Output& out);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  runTest();
  return 0;
}
void runTest() {
  Input in = parseInput();
  Output out = computeResult(in);
  printOutput(out);
}
Input parseInput() {
  Input in;
  int numBooks;
  std::cin >> numBooks >> in.maxDifference;
  for (int i = 0; i < numBooks; i++) {
    int height;
    std::cin >> height;
    in.heights.push_back(height);
  }
  return in;
}
Output computeResult(const Input& in) {
  int n = in.heights.size();
  Output out;
  struct WorklistEntry {
    int value;
    int index;
    WorklistEntry(int value, int index) : value(value), index(index) {}
  };
  std::deque<WorklistEntry> minWorklist;
  std::deque<WorklistEntry> maxWorklist;
  int lo = 0;
  for (int hi = 0; hi < n; hi++) {
    while (!minWorklist.empty() && minWorklist.back().value >= in.heights[hi]) {
      minWorklist.pop_back();
    }
    minWorklist.emplace_back(in.heights[hi], hi);
    while (!maxWorklist.empty() && maxWorklist.back().value <= in.heights[hi]) {
      maxWorklist.pop_back();
    }
    maxWorklist.emplace_back(in.heights[hi], hi);
    while (maxWorklist.front().value - minWorklist.front().value >
           in.maxDifference) {
      if (minWorklist.front().index == lo) {
        minWorklist.pop_front();
      }
      if (maxWorklist.front().index == lo) {
        maxWorklist.pop_front();
      }
      lo++;
    }
    int currLength = hi - lo + 1;
    if (currLength > out.length) {
      out.length = currLength;
      out.lo = {lo};
    } else if (currLength == out.length) {
      out.lo.push_back(lo);
    }
  }
  return out;
}
void printOutput(const Output& out) {
  std::cout << out.length << " " << out.lo.size() << std::endl;
  for (int lo : out.lo) {
    std::cout << lo + 1 << " " << lo + out.length << std::endl;
  }
}
