fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(int argc, char **argv) {
  5. int T;
  6. scanf("%d", &T);
  7. while (T-- != 0) {
  8. double a, b, c, d;
  9. scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
  10. double r = sqrt(d / c);
  11. double x = r * a - b;
  12. double y = r * b - a;
  13. printf("%.10lf %.10lf\n", x, y);
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 4416KB
stdin
1
18 16 72 288
stdout
20.0000000000 14.0000000000