【Codeforces 701D】As Fast As Possible

题目传送门:http://codeforces.com/contest/701/problem/D

额,懵逼了一晚上,结果今天看里约奥运会的时候不小心睡着了(⊙﹏⊙)
在睡梦中,突然发现:貌似根据汽车和人各列一个方程即可QAQ

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std; 

double x,n,k,v1,v2,l;

int main(){
	cin>>n>>l>>v1>>v2>>k;
	x = l*(v1+v2)/(v1*(ceil(n/k)*2-1)+v2);
	printf("%.10lf\n",x/v2+(l-x)/v1);
	return 0;
}