def make_divisors(n): divs = [] for i in range(1, int(n**0.5)+1): if n%i==0: divs.append(i) if i!=n//i: divs.append(n//i) return divs N = int(input()) a = list(map(int, input().split())) A = sum(a) divs = make_divisors(A) divs.sort() for d in divs: acc = 0 for i in range(N): acc += a[i] if acc