#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  long long prefix[n + 1];
  prefix[0] = 0;
  long long int a;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    prefix[i] = prefix[i - 1] + a;
  }
  vector<pair<int, int> > ans;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      long long int sum = prefix[j] - prefix[i];
      vector<pair<int, int> > temp;
      temp.push_back(make_pair(i + 1, j));
      int r = j;
      for (int l = j + 1; l <= n; l++) {
        for (int k = r; k < l; k++) {
          if (prefix[l] - prefix[k] == sum) {
            temp.push_back(make_pair(k + 1, l));
            r = l;
            break;
          }
        }
      }
      if (temp.size() > ans.size()) ans = temp;
    }
  }
  cout << ans.size() << "\n";
  for (auto i : ans) cout << i.first << " " << i.second << "\n";
  return 0;
}
