n = int(input())
A = list(map(int, input().split()))

ans = 999999

for i in range(100):
    x = 0
    for a in A:
        x += (a-i)**2
    ans = min(ans,x)

print(ans) 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 ans = 999999 ans 999999 for i in range(100):
    x = 0
    for a in A:
        x += (a-i)**2
    ans = min(ans,x) i range(100) range 100 x = 0 x 0 for a in A:
        x += (a-i)**2
     a A x += (a-i)**2 x (a-i)**2 a-i a i 2 ans = min(ans,x) ans min(ans,x) min ans x print(ans) print ans n = int(input()) int(input()) n x = 0 0 x A = list(map(int, input().split())) list(map(int, input().split())) A ans = min(ans,x) min(ans,x) ans ans = 999999 999999 ans x += (a-i)**2 (a-i)**2 x
n = int(input())
A = list(map(int, input().split()))

ans = 999999

for i in range(100):
    x = 0
    for a in A:
        x += (a-i)**2
    ans = min(ans,x)

print(ans)