#P3961. [TJOI2013] 黄金矿工
[TJOI2013] 黄金矿工
Description
Recently, Xiao A became obsessed with playing the game “Gold Miner” during class. To avoid being noticed by the teacher, he has to be very cautious, so he always loses.
After losing all his coins, he asks you for help. Each piece of gold can be regarded as a point (no volume). You are given the coordinates of pieces of gold, the time required to mine each, and their value. Some pieces of gold lie on the same straight line; in that case, you must mine them in order. You can instantly rotate the hook to any angle.
Xiao A starts at coordinate . Please help Xiao A compute the maximum total value he can obtain within time .
Input Format
The first line contains two integers and , the number of gold pieces and the total time.
The next lines each contain four integers , , , , denoting the coordinates of a piece of gold, the time to mine it, and its value.
Output Format
Output a single integer, the maximum total value obtainable within time .
3 10
1 1 1 1
2 2 2 2
1 3 15 9
3
3 10
1 1 13 1
2 2 2 2
1 3 4 7
7
Hint
- For of the testdata, .
- For of the testdata, , .
It is guaranteed that , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号