N=int(input())
X=list(map(int,input().split()))
print(min(sum((X[j]-i)**2 for j in range(N)) for i in range(min(X),max(X)+1))) 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 print(min(sum((X[j]-i)**2 for j in range(N)) for i in range(min(X),max(X)+1))) print min(sum((X[j]-i)**2 for j in range(N)) for i in range(min(X),max(X)+1)) min sum((X[j]-i)**2 for j in range(N)) sum (X[j]-i)**2 X[j]-i X[j] X j i 2 X=list(map(int,input().split())) list(map(int,input().split())) X N=int(input()) int(input()) N
N=int(input())
X=list(map(int,input().split()))
print(min(sum((X[j]-i)**2 for j in range(N)) for i in range(min(X),max(X)+1)))