新聞| | PChome| 登入
2012-07-14 09:13:55| 人氣1,003| 回應20 | 上一篇 | 下一篇

[UVA] 10693 - Traffic Volume

推薦 0 收藏 0 轉貼0 訂閱站台

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;
}

台長: Morris
人氣(1,003) | 回應(20)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類 | 個人分類: UVA |
此分類下一篇:[UVA][dfs, 窮舉] 140 - Bandwidth
此分類上一篇:[UVA][Math] 10666 - The Eurocup is Here!

sdfsd
Stick to the fantastic job, That i look over couple articles or blog posts on this subject web-site together with It is my opinion that online webpage is certainly legitimate appealing and features have communities for superb material. đá gà cựa sắt – đấu trường cực hot không thể bỏ qua http://adhesive.ru.com/
2025-10-07 17:21:05
asdfsfs
Common outings let us discuss simplest way to thanks a ton for your personal efforts, which will is why I'm just checking out the positioning on a daily basis, interested in innovative, helpful information and facts. Lots of, thanks a lot! IPTV GERMAN http://beste-iptv.de/
2025-10-07 21:15:34
dfdsfsd
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. Car Safety http://www.lifesafetechnologies.com/
2025-10-25 16:03:39
SDFDFSD
I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! ictoto http://www.ictoto.com
2025-10-25 18:35:51
seo
I merely imagined it usually is a perception to write could possibly help anybody ended up being experiencing difficulity looking into nevertheless We are somewhat doubtful only are permitted to placed labels along with details in below. appel d'offres - Refonte des sites Web http://www.ganeo.ca/masterclass-ganeo/reussir-votre-appel-d-offres-site-web
2025-10-27 19:38:30
seo
this really is great and also meanful. this really is great website. Relating is quite beneficial factor. you might have actually aided a lot of people which check out website and offer these usefull details. best places for investment properties http://www.best-places-for-investment-properties.com/
2025-10-27 22:12:17
adfsdfas
This blog is really great. The information here will surely be of some help to me. Thanks!. covers for swimming pools https://poolcover.co.za/
2025-10-30 18:48:52
seo
We arrived on your weblog whilst concentrating simply somewhat submits. Good technique for following, I'll be book-marking at the same time grab your own total increases. bride underwear http://www.amazon.com/dp/B0CDM33TY2
2025-11-01 20:03:54
seo
Very good Article, We are a major believer throughout putting up responses in internet sites for you to let the web site freelance writers be aware that they’ve included a thing helpful for you to virtual reality! iptv http://iptv-holland.com/
2025-11-04 20:06:56
SDFSDF
I just want to let you know that I just check out your site and I find it very interesting and informative.. https://xtremehd-iptv.co.uk/ http://xtremehd-iptv.co.uk/
2025-11-11 22:34:38
seo
Ones new music is usually wonderful. You could have many incredibly proficient painters. When i hope people the most beneficial connected with achievements. nagad-88.bet/ http://nagad-88.bet/
2025-11-13 20:17:19
seo
the actually great website. the realy informative plus a this kind of excellent career. i enjoy this kind of. reddit reviews puroair and does it improve sinuses http://su77.blog4youth.com/38419685/puroair-home-air-cleaner-and-filter-reviews
2025-11-13 21:51:17
seo
Thanks with regard to publishing this type of excellent post! I discovered your site ideal for my personal requirements. It has fantastic as well as useful articles. Continue the great function! Phenq pills http://duromineaustralia.com/phenq-review/
2025-11-15 20:00:39
seo
it is definitely excellent blog site. it is realy info as well as a a really beneficial task. i adore that. what is the difference between NAD and NAD plus therapy in las vegas http://marketresearchleaks.com/press-release/2025-09-12/23495/lv-longevity-lab-leads-the-charge-in-longevity-medicine-with-dr-wallace-brucker-at-the-helm
2025-11-30 15:46:43
seo
How much can I get with 1xbet promo code With the promo code **1XMAXBONO**, it’s 100% of the deposit amount; without the code, it’s 100%. 1xbet welcome bonus promo code can also be applied. what is 1xbet promo code http://krishderrico.com/pag/?hudeem_s_pomoschyyu_meda.html
2025-11-30 21:23:04
seo
Pulled from genuine bonus listings, this setup supports bespoke plans—smaller sums for safe snooker frame props, bigger for expansive tennis set accumulators—maximizing returns across niches. 1xbet sports bonus code http://rennerusa.com/pages/kak_ponyaty_svoego_lyubimogo_vo_vremya_ssory.html
2025-12-01 19:29:42
is curex legitimate
You will be permitted to posting companies, yet not one-way links, except in cases where they can be permitted plus for issue. is curex legitimate http://daltonfpxf07429.blogolize.com/investigating-if-curex-is-legitimate-for-allergies-77580827
2025-12-09 17:24:55
seu
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
2025-12-09 22:14:29
JimmySEO
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
2025-12-10 17:41:50
yt
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
2025-12-10 22:15:10
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文