[UVA] 10693 - Traffic Volume
Problem F
Traffic
Volume
Input: standard input
Output: standard output
Time Limit: 1 second

In the picture below (or above depending on HTML response :)) you can see a street. It has infinite number of cars on it. The distance between any two consecutive cars is d, length of each car is L and the velocity of each car is v. The volume of cars through a road means the number of cars passing through a road in a specific amount of time. When the velocity is constant, d must be minimum for the volume of cars passing through the road to be maximal. In our model when the velocity of all the cars is v then the minimum possible value of d is v²/(2f) (The more the car velocity the more distance you need to bring down your velocity to zero). Here f is the deceleration due to break.
Keeping this model in mind and given the value of L and f your job is to find the value of v for which the volume of traffic through the road is maximal.
Input
The input file contains several lines of input. Each line of input contains two integers L (0<L<=100) and f(0<f<=10000). The unit of L is meter and the unit of f is meter/second². The input is terminated by a single line whose value of L and f is zero.
Output
For each line of input except the last one produce one line of output. Each line contains two floating-point number v and volume separated by a single space. Here v is the velocity for which traffic flow is maximal and volume is the maximum number of vehicles (of course it is a fraction) passing through the road in an hour. These two floating points should have eight digits after the decimal. Errors less than 1e-5 will be ignored.
Sample Input Output for Sample Input
5 3 0 0 |
5.47722558 1971.80120702
|
Problem setter: Shahriar Manzoor, Member of Elite Problemsetters' Panel
Special Thanks: Derek Kisman
計算公式 !
f(v) = 3600 * v / (L + d) //流量公式, 記得換算單位
d = v*v / (2f)
f(v) = 3600 * v / (L + v*v/(2f))
f'(v) = (4fL - 2fv*v) / (2Lf + v*v)^2
得 v = sqrt(2fL)
#include <stdio.h>
#include <math.h>
int main() {
double L, f;
while(scanf("%lf %lf", &L, &f) == 2) {
if(L == 0 && f == 0)
break;
double v = sqrt(2*L*f);
double fun = 3600*v/(L+v*v/2/f);
printf("%.8lf %.8lf\n", v, fun);
}
return 0;
}
it is definitely excellent blog site. it is realy info as well as a a really beneficial task. i adore that. flowers delivery sharjah http://www.theflowersociety.net
Any movies is normally outstanding. You've gotten a lot of particularly as good writers and singers. Document prefer you will the best quality about financial success. how puroair reviews describe better sleep and easier breathing http://su77.uzblog.net/breathing-fresh-my-review-of-puroair-purifiers-51485408
Dans cette optique, si vous pensez rester inactif sur MelBet pendant un certain temps, vous pouvez demander une suspension temporaire, ou mieux encore, ne rien faire. D'après nos informations, MelBet ne suspend pas les comptes ayant un historique de jeu code promo MelBet ci https://www.bnbaccess.eu/art/meilleur_code_promo_melbet.html Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any suggestions? Many thanks! bonus 1xbet sénégal https://webradio.univ-paris13.fr/pag/code_promo.html Your account will then be credited with the HOT MelBet promo code, which entitles you to cashback. The HOT MelBet promo code you receive generally depends on your loyalty level. Here are the 8 levels, listed in no particular order melbet promo code india https://chhapai.com/pgs/melbet_promo_code_free_bonus_1.html