import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): n=int(input()) aa=LI() s=sum(aa) ans=10**16 for k in range(1,s+1): if k**2>s:break off=0 h=0 for a in aa[:k]: h+=1 if h0 else 0 if h