#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
set<int> s;
int n;
int a[N];
int pre[N];
vector<pair<int, int> > res;
int Solve(int x) {
  res.clear();
  s.clear();
  for (int l = 1; l <= n; l++) {
    for (int i = 1; i + l - 1 <= n; i++) {
      int j = i + l - 1;
      if (pre[j] - pre[i - 1] == x) {
        if (s.lower_bound(i) == s.end() || *s.lower_bound(i) > j) {
          s.insert(i);
          s.insert(j);
          res.push_back({i, j});
        }
      }
    }
  }
  int t = (int)res.size();
  return t;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    pre[i] = pre[i - 1] + a[i];
  }
  int ans = -1, ans_x = a[1];
  for (int l = 1; l <= n; l++) {
    for (int r = l; r <= n; r++) {
      int x = pre[r] - pre[l - 1];
      int t = Solve(x);
      if (ans == -1 || t > ans) {
        ans_x = x;
        ans = t;
      }
    }
  }
  Solve(ans_x);
  printf("%d\n", (int)res.size());
  for (auto it : res) {
    printf("%d %d\n", it.first, it.second);
  }
}
