#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int maxn = 2e3;
;
const int INF = 0x7fffffff;
const int mod = 1e9 + 7;
const double eps = 1e-7;
inline int read_int() {
  char c;
  int ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
inline long long read_ll() {
  char c;
  long long ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
int n, a[maxn + 5], b[maxn + 5], temp, cnt, res;
vector<pair<int, int>> s, f;
int main() {
  n = read_int();
  for (int i = 1; i <= n; i++) {
    a[i] = read_int();
    b[i] = a[i] + b[i - 1];
  }
  for (int l = 1; l <= n; ++l) {
    for (int r = l; r <= n; ++r) {
      temp = b[r] - b[l - 1];
      cnt = 1;
      s.clear();
      s.push_back(pair<int, int>(l, r));
      for (int i = 1; i < l; ++i)
        for (int j = i; j < l; ++j)
          if (temp == b[j] - b[i - 1]) {
            s.push_back(pair<int, int>(i, j));
            ++cnt;
            i = j;
            break;
          }
      for (int i = r + 1; i <= n; ++i)
        for (int j = i; j <= n; ++j)
          if (temp == b[j] - b[i - 1]) {
            s.push_back(pair<int, int>(i, j));
            ++cnt;
            i = j;
            break;
          }
      if (cnt > res) res = cnt, f = s;
    }
  }
  printf("%d\n", (int)f.size());
  for (int i = 0; i < f.size(); ++i) printf("%d %d\n", f[i].first, f[i].second);
  return 0;
}
