#P1802. 5 倍经验日
5 倍经验日
Description
Now absi2011 has taken out mini attribute potions (taking potions to fight is shameful...), and is ready to fight those people.
Since each mini attribute potion can only be used once, absi2011 must use them carefully. Unfortunately, if the amount of potions used does not reach the minimum required to defeat someone, then that fight is a guaranteed loss. For example, if he uses potions to fight someone, but it actually takes potions to win, then you lose, and those two attribute potions are wasted.
There are friends. For each, you are given the experience for losing, the experience for winning, and the minimum number of potions required to defeat that friend.
Find the maximum experience , and output .
Input Format
The first line contains two integers, and .
Each of the next lines contains three integers, representing the experience gained on a loss , the experience gained on a win , and the minimum number of potions required to defeat that friend .
Output Format
A single integer, which is five times the maximum obtainable experience.
6 8
21 52 1
21 70 5
21 48 2
14 38 3
14 36 1
14 36 2
1060
Hint
-
Hint: During the 5x experience event, absi2011 always uses stamina potions instead of these attribute potions.
-
Constraints:
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that , .
- For of the testdata, it is guaranteed that , , .
- For of the testdata, it is guaranteed that , , .
-
Problem Source: fight.pet.qq.com. Authorized by absi2011.
Translated by ChatGPT 5
京公网安备 11011102002149号