import random N = int(input()) H = int(input()) X = [list(map(int,input().split())) for i in range(N)] ans = 10**18 def calc(coef, xp, yp): a2 = yp/(xp+1e-9) a1 = (yp-H)/(xp+1e-9) return coef[0] + a1*coef[1] + (a1*a1)*coef[2] +\ a2*coef[3] + (a2*a2)*coef[4] for xp in range(501): for yp in range(501): coef = [0]*5 for x, y in X: if (x <= xp and y <= yp) or (x > xp and y > yp): coef[0] += y**2 coef[3] += - 2*x*y coef[4] += x**2 else: coef[0] += (y - H)**2 coef[1] += - 2*x*(y - H) coef[2] += x**2 ans = min(calc(coef, xp, yp), ans) ans = min(calc(coef, xp, yp+1), ans) ans = min(calc(coef, xp+1, yp), ans) ans = min(calc(coef, xp+1, yp+1), ans) xtest = H/(- coef[3]/(2*(coef[4]+1e-9)) + coef[1]/(2*(coef[2]+1e-9))) ytest = xtest * (- coef[3]/(2*(coef[4]+1e-9))) ans = min(calc(coef, min(max(xtest,xp),xp+1), min(max(ytest,yp),yp+1)), ans) print(ans)