#P2889. [USACO07NOV] Milking Time S
[USACO07NOV] Milking Time S
题目背景
:::warning{open} This question uses the original question data, but there is a problem with the original question data relative to the question surface. The actual data for this question is . :::
题目描述
Bessie can produce milk in the next hours. For convenience, we number these hours .
Within these hours, FJ has intervals during which he can milk Bessie. The -th interval runs from to and yields gallons of milk.
After each milking, Bessie must rest for hours before FJ can start the next milking.
Now, FJ needs you to compute the maximum total milk Bessie can produce within these hours.
输入格式
The first line contains three integers, representing , , and .
Lines : the -th line contains three integers , , and , describing one milking interval.
输出格式
Output a single integer on one line: the answer.
12 4 2
1 2 8
10 12 19
3 6 24
7 10 31
43
提示
Constraints
For all testdata, it is guaranteed that , , , and .
Translated by ChatGPT 5