N = int(input())
a = list(map(int,input().split()))
loc = round(sum(a) / N)
print(sum(map(lambda x: (x - loc) ** 2,a))) N = int(input()) N int(input()) int input() input a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split loc = round(sum(a) / N) loc round(sum(a) / N) round sum(a) / N sum(a) sum a N print(sum(map(lambda x: (x - loc) ** 2,a))) print sum(map(lambda x: (x - loc) ** 2,a)) sum map(lambda x: (x - loc) ** 2,a) map lambda x: (x - loc) ** 2 (x - loc) ** 2 x - loc x loc 2 x a a = list(map(int,input().split())) list(map(int,input().split())) a loc = round(sum(a) / N) round(sum(a) / N) loc N = int(input()) int(input()) N
N = int(input())
a = list(map(int,input().split()))
loc = round(sum(a) / N)
print(sum(map(lambda x: (x - loc) ** 2,a)))