#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, X: "List[int]"):
    return min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)])


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, X)}')


if __name__ == '__main__':
    main() from typing import * import collections collections import functools functools import itertools itertools import math math import sys sys INF = float('inf') INF float('inf') float 'inf' def solve(N: int, X: "List[int]"):
    return min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)]) solve sum([(x-i)**2 for x in X]) for i in range(1, 100+1) for i in range(1, 100+1) i range(1, 100+1) range 1 100+1 100 1 for i in range(1, 100+1) sum([(x-i)**2 for x in X]) sum [(x-i)**2 for x in X] return min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)]) min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)]) min [sum([(x-i)**2 for x in X]) for i in range(1, 100+1)] N: int N X: "List[int]" X def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, X)}') main sys.setrecursionlimit(10 ** 6) sys.setrecursionlimit sys setrecursionlimit 10 ** 6 10 6 def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens N = int(next(tokens)) N int(next(tokens)) int next(tokens) next tokens int(next(tokens)) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) int(next(tokens)) int next(tokens) next tokens X = [int(next(tokens)) for _ in range(N)] X [int(next(tokens)) for _ in range(N)] print(f'{solve(N, X)}') print f'{solve(N, X)}' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def solve(N: int, X: "List[int]"):
    return min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)]) def solve(N: int, X: "List[int]"):
    return min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)]) solve INF = float('inf') float('inf') INF def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, X)}') def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, X)}') main
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, X: "List[int]"):
    return min([sum([(x-i)**2 for x in X]) for i in range(1, 100+1)])


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, X)}')


if __name__ == '__main__':
    main()
