#include #include #include #include #include #include #include #include #include #include #include #include //#include "toollib.h" #define INT_MAX 2147483647 #define Loop(i, n) for(int i = 0; i < (int)n; i++) #pragma warning (disable:4018) using namespace std; typedef long long int lint; typedef struct { int x; int y; }coordinate; //***** Main Program ***** tuple line_formula(double x1, double y1, double x2, double y2) { if (x1 == x2) { return tuple(1.0, 0, x1*(-1)); } else if (y1 == y2) { return tuple(0, 1.0, y1*(-1)); } else { double a = y2 - y1; double b = x1 - x2; double c = x2*y1 - x1*y2; return tuple(a, b, c); } } int main() { coordinate A, B, P; cin >> A.x >> A.y; cin >> B.x >> B.y; tuple line = line_formula(A.x, A.y, (-1)*B.x, B.y); cout << (-1)*get<2>(line) / get<1>(line) << endl; return 0; }