n=int(input()) l=list(map(int,input().split())) t=sum(l) m=0 for i in range(1,n+1): m=sum(l[:i]) if t%m>0: continue print(m,sum(l)//m) b=[] c=0 for j in range(n): b+=[l[j]] if sum(b)==m: c+=1; b=[] elif sum(b)>m: break if c*m==sum(l): print(c); break