#include #include #include #include #include #include #include #include using namespace std; double x[2], y[2]; double f(double m) { return sqrt(x[0] * x[0] + (m - y[0]) * (m - y[0])) + sqrt(x[1] * x[1] + (m - y[1]) * (m - y[1])); } template double ternarySearch(double l, double r, Function f) { for(int i = 0; i < 200; i++) { double a = (l + l + r) / 3; double b = (l + r + r) / 3; if(f(a) > f(b)) l = a; else r = b; } return l; } int main() { cin.tie(0); ios::sync_with_stdio(false); for(int i = 0; i < 2; i++) { cin >> x[i] >> y[i]; } cout << ternarySearch(0, 1000, f) << endl;; }