当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5035:Delivery

题目描述
Today, Matt goes to delivery a package to Ted. When he arrives at the post office, he finds there are N clerks numbered from 1 to N. All the clerks are busy but there is no one else waiting in line. Matt will go to the first clerk who has finished the service for the current customer. The service time ti for clerk i is a random variable satisfying distribution p(ti = t) = kie^(-kit) where e represents the base of natural logarithm and ki represents the efficiency of clerk i. Besides, accroding to the bulletin board, Matt can know the time ci which clerk i has already spent on the current customer. Matt wants to know the expected time he needs to wait until finishing his posting given current circumstances.
输入解释
The first line of the input contains an integer T,denoting the number of testcases. Then T test cases follow.

For each test case, the first line contains one integer:N(1<=N<=1000)

The second line contains N real numbers. The i-th real number ki(0<=ki<=1) indicates the efficiency of clerk i.

The third line contains N integers. The i-th integer indicates the time ci(0<=ci<=1000) which clerk i has already spent on the current customer.
输出解释
For each test case, output one line "Case #x: y", where x is the case number (starting from 1), y is the answer which should be rounded to 6 decimal places.
输入样例
2
2
0.5 0.4
2 3
3
0.1 0.1 0.1
3 2 5
输出样例
Case #1: 3.333333
Case #2: 13.333333
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5035

最后修改于 2020-10-25T23:19:09+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/1500MS(Java/Others) 262144/262144K(Java/Others)