def nearest_int(f):
  if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1

N = int(input())
X = list(map(lambda x: int(x), input().split(" ")))
ave = sum(X) / N
avei = nearest_int(ave)

print(sum([(x - avei) ** 2 for x in X])) def nearest_int(f):
  if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1 nearest_int if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1 f - int(f) < 0.5 f - int(f) f int(f) int f 0.5 return int(f) int(f) int f return int(f) + 1 int(f) + 1 int(f) int f 1 f f N = int(input()) N int(input()) int input() input X = list(map(lambda x: int(x), input().split(" "))) X list(map(lambda x: int(x), input().split(" "))) list map(lambda x: int(x), input().split(" ")) map lambda x: int(x) int(x) int x x input().split(" ") ().split () input split " " ave = sum(X) / N ave sum(X) / N sum(X) sum X N avei = nearest_int(ave) avei nearest_int(ave) nearest_int ave (x - avei) ** 2 for x in X for x in X x X for x in X (x - avei) ** 2 x - avei x avei 2 print(sum([(x - avei) ** 2 for x in X])) print sum([(x - avei) ** 2 for x in X]) sum [(x - avei) ** 2 for x in X] N = int(input()) int(input()) N def nearest_int(f):
  if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1 def nearest_int(f):
  if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1 nearest_int ave = sum(X) / N sum(X) / N ave X = list(map(lambda x: int(x), input().split(" "))) list(map(lambda x: int(x), input().split(" "))) X avei = nearest_int(ave) nearest_int(ave) avei
def nearest_int(f):
  if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1

N = int(input())
X = list(map(lambda x: int(x), input().split(" ")))
ave = sum(X) / N
avei = nearest_int(ave)

print(sum([(x - avei) ** 2 for x in X]))