#include <bits/stdc++.h>
using namespace std;
vector<map<int, int>> GetSums(const vector<int> &vec) {
  vector<map<int, int>> sums(vec.size());
  sums.back().insert({vec.back(), vec.size() - 1});
  for (int i = vec.size() - 2; i >= 0; i -= 1) {
    for (const auto &s : sums[i + 1]) {
      sums[i].insert({s.first + vec[i], s.second});
    }
    sums[i][vec[i]] = i;
  }
  return sums;
}
vector<pair<int, int>> GetBlocks(const vector<map<int, int>> &sums, int s) {
  vector<int> left(sums.size(), -1);
  for (size_t i = 0; i < sums.size(); i += 1) {
    if (sums[i].find(s) != sums[i].end()) {
      left[sums[i].at(s)] = i;
    }
  }
  vector<pair<int, int>> blocks;
  auto index = -1;
  for (size_t i = 0; i < sums.size(); i += 1) {
    if (left[i] > index) {
      blocks.push_back({left[i], i});
      index = i;
    }
  }
  return blocks;
}
vector<pair<int, int>> Brute(const vector<map<int, int>> &sums) {
  set<int> possible;
  for (const auto &m : sums) {
    for (const auto &p : m) {
      possible.insert(p.first);
    }
  }
  vector<pair<int, int>> res;
  for (const auto &s : possible) {
    auto blocks = GetBlocks(sums, s);
    if (blocks.size() > res.size()) {
      res = blocks;
    }
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (auto &num : vec) {
    cin >> num;
  }
  auto sums = GetSums(vec);
  auto res = Brute(sums);
  cout << res.size() << "\n";
  for (const auto &p : res) {
    cout << p.first + 1 << " " << p.second + 1 << "\n";
  }
  return 0;
}
