赞
踩
http://codeforces.com/contest/700/problem/A
代码如下:
#include <iostream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;
int main() {
int n, k;
double l, v1, v2;
cin >> n >> l >> v1 >> v2 >> k;
int b = (n + k - 1) / k;
double den = (2 * (b - 1) * v1 / (v1 + v2)) + 1;
double x = l / den;
double ans = x / v2 + (l - x) / v1;
printf("%0.9f\n", ans);
return 0;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。