fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double p, d, a, b, f, t, flyDist;
  6. int n;
  7. cin >> p;
  8. for (int i = 0; i < p; i++){
  9. cin >> n >> d >> a >> b >> f;
  10. t = d / (a + b);
  11. flyDist = f * t;
  12. cout.precision(2);
  13. cout << fixed << n << " " << flyDist << endl;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 4468KB
stdin
5
1 250 10 15 20
2 10.7 3.5 4.7 5.5
3 523.7 15.3 20.7 33.3
4 1000 30 30 50
5 500 15 15 25
stdout
1 200.00
2 7.18
3 484.42
4 833.33
5 416.67