Advertisement
JouJoy

N

Dec 12th, 2021
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include<iomanip>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     ios::sync_with_stdio(false);
  9.     cin.tie(0);
  10.     int n, k;
  11.     double l, v1, v2;
  12.     cin >> n >> l >> v1 >> v2 >> k;
  13.     int blocks = (n + k - 1) / k;
  14.     double t = l / (v1 * blocks + (v2 - v1) / 2);
  15.     double each = (v1 + v2) / 2 * t;
  16.     cout << fixed << setprecision(12);
  17.     cout << (l - each) / v1 + each / v2 << endl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement