#include using namespace std; #define rep(i,n) for(ll i=0;i<(n);++i) using ll = long long; using pll = pair; constexpr ll INF = (1LL<<60); constexpr ll MOD = (1e9+7); //constexpr ll MOD = (998244353); template bool chmax(T &a,const T &b){if(a bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;} #if loc||debg||local||debug void dump(){cerr< void dump(T&& h, Ts&&... t){cerr<(t)...);} #else template void dump(T&& h, Ts&&... t){} #endif template istream &operator>>(istream&is,vector&v){for(auto &elemnt:v)is>>elemnt;return is;} template istream &operator>>(istream&is,pair&p){is>>p.first>>p.second;return is;} template ostream &operator<<(ostream& os,vectorconst& v){for(auto const& vi:v)os<vector vec(size_t a){return vector(a);} templateauto vec(size_t a, Ts... ts){return vector(ts...))>(a, vec(ts...));} templatevector _vec(size_t a,T v){return vector(a,v);} templateauto _vec(size_t a, Ts... ts){return vector(ts...))>(a, _vec(ts...));} int main(){ int n; cin>>n; vector a(n); cin>>a; vector s(n+1); rep(i,n)s[i+1]=s[i]+a[i]; ll ans = 0; for(ll sum=*max_element(a.begin(),a.end());sum<=1e7;++sum){ ll cnt=0,now=0; while(now