#P1417. 烹调方案
烹调方案
Description
There are ingredients. Each ingredient has three attributes, , , and . If ingredient is completed at time , you gain a deliciousness score of . Cooking ingredient takes time.
As everyone knows, gw is not very good at cooking, so you need to design a cooking plan to maximize the deliciousness score. All cooking must be finished within time .
Input Format
The first line contains two positive integers and , representing the time needed to reach Earth and the number of ingredients.
- The next line contains integers, .
- The next line contains integers, .
- The next line contains integers, .
Output Format
Output the maximum deliciousness score.
74 1
502
2
47
408
Hint
- Constraints:
- For of the testdata, .
- For of the testdata, .
- All numbers are less than .
- Source: adapted by tinylic.
Translated by ChatGPT 5
京公网安备 11011102002149号