N = int(input())
X = list(map(int, input().split()))

ave = sum(X) / float(N)
my_round_int = lambda x: int((x * 2 + 1) // 2)
t = my_round_int(ave)
val = 0
for x in X:
  val += (t - x)**2
print(val) 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 ave = sum(X) / float(N) ave sum(X) / float(N) sum(X) sum X float(N) float N my_round_int = lambda x: int((x * 2 + 1) // 2) my_round_int lambda x: int((x * 2 + 1) // 2) int((x * 2 + 1) // 2) int (x * 2 + 1) // 2 x * 2 + 1 x * 2 x 2 1 2 x t = my_round_int(ave) t my_round_int(ave) my_round_int ave val = 0 val 0 for x in X:
  val += (t - x)**2 x X val += (t - x)**2 val (t - x)**2 t - x t x 2 print(val) print val N = int(input()) int(input()) N my_round_int = lambda x: int((x * 2 + 1) // 2) lambda x: int((x * 2 + 1) // 2) my_round_int X = list(map(int, input().split())) list(map(int, input().split())) X val += (t - x)**2 (t - x)**2 val ave = sum(X) / float(N) sum(X) / float(N) ave t = my_round_int(ave) my_round_int(ave) t val = 0 0 val
N = int(input())
X = list(map(int, input().split()))

ave = sum(X) / float(N)
my_round_int = lambda x: int((x * 2 + 1) // 2)
t = my_round_int(ave)
val = 0
for x in X:
  val += (t - x)**2
print(val)
