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

建议使用的浏览器:

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

5477:A Sweet Journey

题目描述
Master Di plans to take his girlfriend for a travel by bike. Their journey, which can be seen as a line segment of length L, is a road of swamps and flats. In the swamp, it takes A point strengths per meter for Master Di to ride; In the flats, Master Di will regain B point strengths per meter when riding. Master Di wonders:In the beginning, he needs to prepare how much minimum strengths. (Except riding all the time,Master Di has no other choice)

输入解释
In the first line there is an integer t ($1 \leq t \leq 50$), indicating the number of test cases.
For each test case:
The first line contains four integers, n, A, B, L.
Next n lines, each line contains two integers: $L_i, R_i$, which represents the interval $[L_i, R_i]$ is swamp.
$1 \leq n \leq 100, 1 \leq L \leq 10^5,1 \leq A \leq 10,1 \leq B \leq 10,1 \leq L_i < R_i \leq L$.
Make sure intervals are not overlapped which means $R_i < L_{i + 1}$ for each i ($1 \leq i < n$).
Others are all flats except the swamps.
输出解释
For each text case:
Please output “Case #k: answer”(without quotes) one line, where k means the case number counting from 1, and the answer is his minimum strengths in the beginning.
输入样例
1
2 2 2 5
1 2
3 4
输出样例
Case #1: 0
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5477

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)