#include #define GET_MACRO(a, b, c, NAME, ...) NAME #define rep(...) GET_MACRO(__VA_ARGS__, rep3, rep2)(__VA_ARGS__) #define rep2(i, a) rep3 (i, 0, a) #define rep3(i, a, b) for (int i = (a); i < (b); i++) #define repr(...) GET_MACRO(__VA_ARGS__, repr3, repr2)(__VA_ARGS__) #define repr2(i, a) repr3 (i, 0, a) #define repr3(i, a, b) for (int i = (b) - 1; i >= (a); i--) #define chmin(a, b) ((b) < a && (a = (b), true)) #define chmax(a, b) (a < (b) && (a = (b), true)) using namespace std; typedef long long ll; int main() { double l = -1e6, r = 1e6; double x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; rep (i, 5000) { double m1 = (l * 2 + r) / 3; double m2 = (l + r * 2) / 3; double f1 = hypot(x1, y1 - m1) + hypot(x2, y2 - m1); double f2 = hypot(x1, y1 - m2) + hypot(x2, y2 - m2); if (f1 < f2) { r = m2; } else { l = m1; } } printf("%.20f\n", l); return 0; }