#P12247. 跳舞机
跳舞机
Description
Little O wants to operate an arcade, where the dance machine's operation is crucial.
There is one dance machine in Little O's arcade that can accommodate at most one player at any given time. Each game session requires a complete and continuous playtime of exactly minutes.
The venue will be open for minutes. During this period, players want to use the dance machine, numbered from to . Player will be present from minute to minute (inclusive) and can play any number of complete game sessions during their stay. Each completed session generates excitement points. Note that for player to play a session, the entire -minute duration must be fully contained within their stay interval .
Little O wants to maximize the total excitement points from all players. Your task is to determine the maximum possible total excitement.
Input Format
The input consists of lines:
- Line : Three integers , , - number of players, operating duration, and session length.
- Lines to : Each line contains three integers , , - the stay interval and excitement per session for player .
Output Format
Output a single integer - the maximum total excitement possible.
3 6 2
1 5 1
5 6 2
5 6 3
5
4 7 3
1 7 1
2 5 4
4 7 5
1 2 10
9
Hint
Sample #1 Explanation
Optimal schedule:
- Player plays at and 。
- Player plays at 。
Total: points (maximum possible)
Sample #2 Explanation
Optimal schedule:
- Player plays at 。
- Player plays at 。
Total: points (maximum possible)
Constraints
- ;
- ;
- ;
- 。
Let . Subtask constraints:
| Test Case | Range | Range | Special Properties |
|---|---|---|---|
| None | |||
| None | |||
| None | |||
京公网安备 11011102002149号