N = int(input())
X = [int(x) for x in input().split()]

G = int(sum(X)/N + 0.5)

ans = sum((x-G)**2 for x in X)

print(ans) N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x X = [int(x) for x in input().split()] X [int(x) for x in input().split()] G = int(sum(X)/N + 0.5) G int(sum(X)/N + 0.5) int sum(X)/N + 0.5 sum(X)/N sum(X) sum X N 0.5 ans = sum((x-G)**2 for x in X) ans sum((x-G)**2 for x in X) sum (x-G)**2 x-G x G 2 print(ans) print ans N = int(input()) int(input()) N ans = sum((x-G)**2 for x in X) sum((x-G)**2 for x in X) ans X = [int(x) for x in input().split()] [int(x) for x in input().split()] X G = int(sum(X)/N + 0.5) int(sum(X)/N + 0.5) G
N = int(input())
X = [int(x) for x in input().split()]

G = int(sum(X)/N + 0.5)

ans = sum((x-G)**2 for x in X)

print(ans)