Problem 3034 --Final Exam

3034: Final Exam

"
Time Limit $2$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $1$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
Final Exam is coming! Cuber QQ has now one night to prepare for tomorrow's exam. 

The exam will be a exam of problems sharing altogether mm points. Cuber QQ doesn't know about the exact distribution. Of course, different problems might have different points; in some extreme cases, some problems might worth 00 points, or all mm points. Points must be integers; a problem cannot have 0.50.5 point. 

What he knows, is that, these nn problems will be about nn totally different topics. For example, one could be testing your understanding of Dynamic Programming, another might be about history of China in 19th century. So he has to divide your night to prepare each of these topics separately. Also, if one problem is worth xx points in tomorrow's exam, it takes at least x+1x+1 hours to prepare everything you need for examination. If he spends less than x+1x+1 hours preparing, he shall fail at this problem. 

Cuber QQ's goal, strangely, is not to take as much points as possible, but to solve at least kk problems no matter how the examination paper looks like, to get away from his parents' scoldings. So he wonders how many hours at least he needs to achieve this goal. 
The first line of the input is an integer tt (1≤t≤20 0001≤t≤20 000), denoting the number of test cases. 

Each test case are three space-separated integers n,m,kn,m,k (0≤m≤1090≤m≤1091≤k≤n≤1091≤k≤n≤109). 
For each test case, output the number of hours Cuber QQ needs. 
2
1 10 1
10 109 10
11
1100
Cuber QQ should solve one problem in sample 1, so he at least prepares 11 hours when the problem one is 10 point. 
Cuber QQ should solve all the ten problems in sample 2, so he at least prepares 110 hours for each problem because there may be one problem is 109 point.

推荐代码 查看3034 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$12 $ms] 淡意的温柔 591117 2020-06-06 08:09:39
内存最少[$2080 $KB] 淡意的温柔 591117 2020-06-06 08:09:39
第一AC 淡意的温柔 591117 2020-06-06 08:09:39
第一挑战 淡意的温柔 591117 2020-06-06 08:09:39

赛题来源/所属竞赛 2019 Multi-University Training Contest 7 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛