#include #define rep(i,s,n) for(int i = int(s); i < int(n); i++) using i64 = std::int64_t; template bool chmin(T &a, T b) { if(a < b) return false; a = b; return true; } int main() { std::cout << std::fixed << std::setprecision(15); int n; i64 h; std::cin >> n >> h; std::vector> ps(n); for(auto &[x, y]: ps) { std::cin >> x >> y; } assert(n <= 25); using ld = long double; ld ans = std::numeric_limits::max(); auto calc_score = [](const std::vector a) -> ld { if(a[2] == 0) { assert(a[1] == 0 && a[0] == 0); return 0; } return ld(a[0]) - ld(a[1] * a[1]) / ld(4 * a[2]); }; rep(bit,0,1< u(3, 0), d(3, 0); rep(i,0,n) { auto [x, y] = ps[i]; if((bit >> i) & 1) { u[0] += (y - h) * (y - h); u[1] += -2*x*(y-h); u[2] += x*x; } else { d[0] += y*y; d[1] += -2*x*y; d[2] += x*x; } } chmin(ans, calc_score(u) + calc_score(d)); } std::cout << ans << '\n'; }