using System; using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Linq; using System.Text; using System.IO; using System.Reflection; using static System.Math; using System.Numerics; static class Program{ const int mod=(int)1e9+7; static void Main(){ Sc sc=new Sc(); var n=sc.I; var a=sc.Ia2; var r=new int[n+1]; var hs=new HashSet(); for(int i = 1;i<=n;i++) { r[i]=r[i-1]+a[i]; hs.Add(r[i]); } int ans=0; Pn(r[n],(e)=>{ int p=0; while(hs.Contains(p+e)){p+=e;} if(p==r[n]){ans=Max(ans,r[n]/e);} }); Console.WriteLine("{0}",ans); } static void Pn(int n,Action f){ var q=Sqrt(n); for(int i = 1;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i