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

建议使用的浏览器:

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

6000:Wash

题目描述
Mr.Panda is about to engage in his favourite activity doing laundry! He’s brought L indistinguishable loads of laundry to his local laundromat, which has N washing machines and M dryers.The $i^{th}$ washing machine takes $W_i$ minutes to wash one load of laundry, and the $i^{th}$ dryer takes Di minutes to dry a load of laundry.
At any point in time, each machine may only be processing at most one load of laundry.
As one might expect, Panda wants to wash and then dry each of his L loads of laundry. Each load of laundry will go through the following steps in order:
1. A non-negative amount of time after Panda arrives at the laundromat, Panda places the load in an unoccupied washing machine i.
2. Wi minutes later, he removes the load from the washing machine, placing it in a temporary holding basket (which has unlimited space)
3. A non-negative amount of time later, he places the load in an unoccupied dryer j
4. Dj minutes later, he removes the load from the dryer Panda can instantaneously add laundry to or remove laundry from a machine. Help Panda minimize the amount of time (in minutes after he arrives at the laundromat) after which he can be done washing and drying all L loads of laundry!
输入解释
The first line of the input gives the number of test cases, T.
T test cases follow. Each test case consists of three lines. The first line contains three integer L, N, and M.
The second line contains N integers $W_1, W_2, ... , W_N$ representing the wash time of each wash machine.
The third line contains M integers $D_1, D_2, ..., D_M$ representing the dry time of each dryer.
输出解释
For each test case, output one line containing “Case #x: y”, where x is the test case number (starting from 1) and y is the minimum time it will take Panda to finish his laundry.

limits


$\bullet 1 ≤ T ≤ 100$.
$\bullet 1 ≤ L ≤ 10^6$.
$\bullet 1 ≤ N, M ≤ 10^5$.
$\bullet 1 ≤ W_i, D_i ≤ 10^9$.
输入样例
2
1 1 1
1200
34
2 3 2
100 10 1
10 10
输出样例
Case #1: 1234
Case #2: 12
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

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

题目来源 2016 CCPC-Final

源链接: HDU-6000

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

共提交 23

通过率 8.7%
时间上限 内存上限
20000/10000MS(Java/Others) 64000/64000K(Java/Others)