Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Milking Time
Description Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next Farmer John has a list of N), an ending hour (starting_hour < _{i}ending_hour ≤ _{i}N), and a corresponding efficiency (1 ≤ efficiency ≤ 1,000,000) which indicates how many gallons of milk that he can get out of Bessie in that interval. Farmer John starts and stops milking at the beginning of the starting hour and ending hour, respectively. When being milked, Bessie must be milked through an entire interval._{i}Even Bessie has her limitations, though. After being milked during any interval, she must rest Input * Line 1: Three space-separated integers: ending_hour , and _{i}efficiency _{i}Output * Line 1: The maximum number of gallons of milk that Bessie can product in the Sample Input 12 4 2 1 2 8 10 12 19 3 6 24 7 10 31 Sample Output 43 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator