#include using namespace std; struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i> N; int t = 0; unordered_set s; while (N--) { int a; cin >> a; t += a; s.insert(t); } int ret = 1; FOR(i, 2, t) if (t % i == 0) { bool f = true; FOR(j, 1, i + 1) if (!s.count(t / i * j)) f = false; if (f) ret = i; } cout << ret << endl; }