编程介的小学生 2018-12-05 05:03 采纳率: 20.5%
浏览 347
已采纳

一个有关任务算法的问题,不太会做,请教各位了。

Problem Description
There are two kinds of tasks, namely A and B. There are N workers and the i-th worker would like to finish one task A in ai minutes, one task B in bi minutes. Now you have X task A and Y task B, you want to assign each worker some tasks and finish all the tasks as soon as possible. You should note that the workers are working simultaneously.

Input
In the first line there is an integer T(T<=50), indicates the number of test cases.

In each case, the first line contains three integers N(1<=N<=50), X,Y(1<=X,Y<=200). Then there are N lines, each line contain two integers ai, bi (1<=ai, bi <=1000).

Output
For each test case, output “Case d: “ at first line where d is the case number counted from one, then output the shortest time to finish all the tasks.

Sample Input
3
2 2 2
1 10
10 1
2 2 2
1 1
10 10

3 3 3
2 7
5 5
7 2

Sample Output
Case 1: 2
Case 2: 4
Case 3: 6

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-03-28 10:45
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 深度学习残差模块模型
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)