#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<pair<long long, long long>> ans;
  for (long long p = 0; p < n; p++) {
    for (long long q = p; q < n; q++) {
      long long sum = 0;
      for (long long s = p; s <= q; s++) sum += a[s];
      vector<pair<long long, long long>> answer, picker;
      for (long long i = 0; i < n; i++) {
        long long val = 0;
        long long pos = -1;
        for (long long j = i; j < n; j++) {
          val += a[j];
          if (val == sum) {
            pos = j;
            break;
          }
        }
        if (pos != -1) {
          picker.push_back({i + 1, pos + 1});
        }
      }
      for (auto u : picker) {
        if (answer.empty()) {
          answer.push_back(u);
        } else {
          if (answer.back().second > u.second) {
            answer.pop_back();
            answer.push_back(u);
          } else if (answer.back().second < u.first) {
            answer.push_back(u);
          }
        }
      }
      if (ans.size() < answer.size()) {
        ans = answer;
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto u : ans) {
    cout << u.first << " " << u.second << "\n";
  }
  return 0;
}
