from collections import defaultdict N=int(input()) A=list(map(int,input().split())) def solve(N,A): ans=N*(N+1)//2 for m in range(1,31): C=[0]+[a-m for a in A] for i in range(1,N+1): C[i]+=C[i-1] dct=defaultdict(int) for i in range(N+1): dct[C[i]]+=1 if i