题解 | 元素方碑
元素方碑
https://www.nowcoder.com/practice/5c6e7ed4726e41f4ac99a4dedf1e5bb2
n = int(input())
for _ in range(n):
m = int(input())
ls = list(map(int,input().split()))
if len(ls)>1:
a = ls[::2]
b = ls[1::2]
if sum(a)/len(a)==sum(b)/len(b) and sum(ls)%m==0:
print("YES")
else:
print("NO")
else:
print("YES")
