#d2461. 任务分配
任务分配
Task Assignment
Problem Description
You have tasks. The -th task starts at time and ends at time ; if you do it, you get a profit of .
But you can do at most one task at any moment. Choose which tasks to do so that your total profit is maximized.
Note that it is allowed to start the next task immediately after the previous one ends.
Input Format
The first line contains an integer .
The next lines each contain three integers .
Output Format
Output one number: the answer.
Sample Input
3
1 3 100
2 4 199
3 5 100
Sample Output
200
Constraints
For all data, , , and .