#P3961. [TJOI2013] 黄金矿工

    ID: 2896 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>2013各省省选排序背包图的建立,建图天津

[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 NN 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 (0,0)(0, 0). Please help Xiao A compute the maximum total value he can obtain within time TT.

Input Format

The first line contains two integers NN and TT, the number of gold pieces and the total time.

The next NN lines each contain four integers xx, yy, tt, vv, 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 TT.

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 30%30\% of the testdata, 0<T4×1030 < T \le 4 \times 10^3.
  • For 100%100\% of the testdata, 1N2001 \le N \le 200, 0<T4×1040 < T \le 4 \times 10^4.

It is guaranteed that 0x2000 \le |x| \le 200, 0<y2000 < y \le 200, 0<t2000 < t \le 200, 0v2000 \le v \le 200.

Translated by ChatGPT 5