/* -*- coding: utf-8 -*- * * 1175.cc: No.1175 Simultaneous Equations - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int a, b, c, d, e, f; scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f); /* |a b||x| = |c| -> |x| = ___1___ |e -b||c| |d e||y| |f| |y| (ae-bd) |-d a||f| */ int p = a * e - b * d; double x = (double)( e * c - b * f) / p; double y = (double)(-d * c + a * f) / p; printf("%.15lf %.15lf\n", x, y); return 0; }