Problem1465--Power Consumption Calculation电脑能耗

1465: Power Consumption Calculation电脑能耗

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Submit

Description

有一台电脑,在活跃状态下,每秒钟耗能p1,在没人碰之后的t1秒后,进入休息状态,每秒钟耗能p2,如果再有t2秒没人碰的话,就会进入睡眠状态,每秒钟耗能p3

给你这个人碰电脑的n个区间时间,问你这台电脑的耗能是多少

Input

一行,分别是整数n,P1,P2,P3,T1,T2,1<=n<=100,0<=P1,P2,P3<=100,1<=T1,T2<=60

Output

电脑消耗了多少能耗

Sample Input Copy

1 3 2 1 5 10
0 10

Sample Output Copy

30

Source/Category

模拟