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