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