#include int main(){ std::cin.tie(0); std::ios::sync_with_stdio(false); double ax, ay, bx, by; std::cin >> ax >> ay >> bx >> by; bx = -bx; if(ax != bx) std::cout << -ax * ((ay - by) / (ax - bx)) + ay << std::endl; else std::cout << (ay + by) / 2 << std::endl; return 0; }