#include<iostream>
using namespace std;
int main()
{
int n, p1, p2, p3, t1, t2;
cin >> n >> p1 >> p2 >> p3 >> t1 >> t2;
int l, r, s=0;
cin >> l >> r;
s += p1 * (r - l);
n--;
int a, b;
while(n--)
{
cin >> a >> b;
if(a-r>=t2+t1)
{
s += p1 * t1;
s += p2 * t2;
s += p3 * (a - r - t2-t1);
s += p1 * (b - a);
}
if(a-r<t2+t1&&a-r>=t1)
{
s += p1 * t1;
s += p2 * (a-r-t1);
s += p1 * (b - a);
}
if(a-r<t1)
{
s += p1 * (a - r);
s += p1 * (b - a);
}
r = b;
}
cout << s;
}
HNU软件实训-电能消耗
最新推荐文章于 2024-10-31 16:16:13 发布