number = int(input())
score = list(map(int,input().split()))
kiroku = 10**10
for i in range(100):
    answer = 0
    for j in range(number):
        answer += (score[j] - i-1)**2
    if answer < kiroku:
        kiroku = answer
print(kiroku) number = int(input()) number int(input()) int input() input score = list(map(int,input().split())) score list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split kiroku = 10**10 kiroku 10**10 10 10 for i in range(100):
    answer = 0
    for j in range(number):
        answer += (score[j] - i-1)**2
    if answer < kiroku:
        kiroku = answer i range(100) range 100 answer = 0 answer 0 for j in range(number):
        answer += (score[j] - i-1)**2
     j range(number) range number answer += (score[j] - i-1)**2 answer (score[j] - i-1)**2 score[j] - i-1 score[j] - i score[j] score j i 1 2 if answer < kiroku:
        kiroku = answer answer < kiroku answer kiroku kiroku = answer kiroku answer print(kiroku) print kiroku number = int(input()) int(input()) number kiroku = 10**10 10**10 kiroku kiroku = answer answer kiroku score = list(map(int,input().split())) list(map(int,input().split())) score answer += (score[j] - i-1)**2 (score[j] - i-1)**2 answer answer = 0 0 answer
number = int(input())
score = list(map(int,input().split()))
kiroku = 10**10
for i in range(100):
    answer = 0
    for j in range(number):
        answer += (score[j] - i-1)**2
    if answer < kiroku:
        kiroku = answer
print(kiroku)