/* Wrong Answer */ #include using namespace std; using ll = long long; using ld = long double; int main(){ ll n, h; cin >> n >> h; ld ans = 1e18; vector xs(n), ys(n); for (int i = 0; i < n; i++) cin >> xs[i] >> ys[i]; ll rx = 0; for (int i = 0; i < n; i++) rx = max(rx,xs[i]); for (int fy = 0; fy <= 500; fy++) for (int gy = 0; gy <= 500; gy++){ ld cur = 0; for (int i = 0; i < n; i++){ ld fv = ys[i] - ld(fy-h)/rx*xs[i] - h; ld gv = ys[i] - ld(gy)/rx*xs[i]; cur += min(fv*fv,gv*gv); } ans = min(ans,cur); } cout << fixed << setprecision(15) << ans << endl; }