CF10A.Power Consumption Calculation
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minutes from the start of the screensaver, laptop switches to the "sleep" mode and consumes P3 watt per minute. If Tom moves the mouse or touches the keyboard when the laptop is in the second or in the third mode, it switches to the first (normal) mode. Tom's work with the laptop can be divided into n time periods [l1,r1],[l2,r2],...,[ln,rn] . During each interval Tom continuously moves the mouse and presses buttons on the keyboard. Between the periods Tom stays away from the laptop. Find out the total amount of power consumed by the laptop during the period [l1,rn] .
计算功率消耗
Tom对他最喜爱的笔记本电脑的功耗很感兴趣。他的笔记本电脑有三种模式。在正常模式下,笔记本电脑每分钟消耗 P1 瓦特。在 Tom 上次移动鼠标或触摸键盘后的 T1 分钟后,屏幕保护程序启动,功耗变为 P2 瓦特每分钟。最后,在屏幕保护程序开始后的 T2 分钟后,笔记本电脑切换到 "睡眠" 模式,并消耗 P3 瓦特每分钟。如果 Tom 在笔记本电脑处于第二或第三模式时移动鼠标或触摸键盘,则它将切换到第一(正常)模式。Tom 使用笔记本电脑的工作可以分为 n 个时间段 [l1, r1], [l2, r2], ..., [ln, rn]。在每个区间内,Tom 连续移动鼠标并按键盘上的按钮。在这些时间段之间,Tom 远离笔记本电脑。
请你找出笔记本电脑在时间段 [l1, rn] 内消耗的总功率。
感谢Macw提供翻译
输入格式
The first line contains 6 integer numbers n , P1 , P2 , P3 , T1 , T2 ( 1<=n<=100,0<=P1,P2,P3<=100,1<=T1,T2<=60 ). The following n lines contain description of Tom's work. Each i -th of these lines contains two space-separated integers li and ri ( 0<=li<ri<=1440 , ri<li+1 for i<n ), which stand for the start and the end of the i -th period of work.
输入包含多行。
第一行输入六个整数,分别为 n,P1,P2,P3,T1,T2。其中 1≤n≤1000,0≤P1,P2,P3≤100,1≤T1,T2≤60。
接下来的 n 行,每一行输入两个整数 li,ri。保证 0≤li<ri≤1440,ri<li+1fori<n。
输出格式
Output the answer to the problem.
输出一个整数,表示本题的答案。
输入输出样例
输入#1
1 3 2 1 5 10 0 10
输出#1
30
输入#2
2 8 4 2 5 10 20 30 50 100
输出#2
570
说明/提示
请注意,本题空间限制为256MB,是默认空间限制的两倍。