#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using Pll = pair; using Pii = pair; constexpr ll MOD = 1000000007; constexpr long double EPS = 1e-10; constexpr int dyx[4][2] = { { 0, 1}, {-1, 0}, {0,-1}, {1, 0} }; int check(int n, int *a, int i) { int s = 0; int cnt = 0; for(int j=0;j> n; int a[n], s = 0; for(int i=0;i> a[i]; s += a[i]; } int ans = 0, cnt; for(int i=1;i<=int(sqrt(s))+1;++i) { if(s % i != 0) continue; cnt = check(n, a, i); ans = max(cnt, ans); cnt = check(n, a, s/i); ans = max(cnt, ans); } cout << ans << endl; }