(let [n (read-line) xs (map read-string (clojure.string/split (read-line) #" "))]
  (loop [m 1000000 p 100]
    (if (< p 1) (println (int m))
      (recur (min m (reduce #'+ (map #(Math/pow (- % p) 2) xs))) (dec p)))))
