# #7. 【NOI2014】购票

7 3
1 2 20 0 3
1 5 10 100 5
2 4 10 10 10
2 9 1 100 10
3 5 20 100 10
4 4 20 0 10

40
150
70
149
300
150

### 限制与约定

2$n = 2 \times 10^3$$t = 0 3t = 3 4n = 2 \times 10^5$$t = 0$
5$t = 2$
6$t = 1$
7
8
9$t = 3$
10