#include<bits/stdc++.h>
using namespace std;
int sij=0;
int main(){
int n, P1, P2, P3, T1, T2;
    cin >> n >> P1 >> P2 >> P3 >> T1 >> T2;
    int total = 0;          
    int prev_end = 0;       
    for (int i = 0; i < n; i++) {
        int l, r;
        cin >> l >> r;
        total += (r - l) * P1;
        if (i > 0) {
            int rest = l - prev_end;  
            if (rest <= T1) {
                total += rest * P1;
            } else if (rest <= T1 + T2) {
                total += T1 * P1 + (rest - T1) * P2;
            } else {
                total += T1 * P1 + T2 * P2 + (rest - T1 - T2) * P3;
            }
        }
        prev_end = r;  
    }
    
    cout << total << endl;
    return 0;
}

0 条评论

目前还没有评论...

信息

ID
1
时间
1000ms
内存
256MiB
难度
3
标签
递交数
64
已通过
33
上传者