#abc274f. [abc274_f]Fishing
[abc274_f]Fishing
Problem Statement
On a number line, there are fish swimming.
Fish , which has a weight of , is at the coordinate at time and moves at a speed of in the positive direction.
Takahashi will choose an arbitrary real number greater than or equal to and do the following action at time just once.
Action: Choose an arbitrary real number . Catch all fish whose coordinates are between and , inclusive.
Find the maximum total weight of fish that he can catch.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 10
100 0 100
1 10 30
10 20 10
Sample Output 1
111
At time , fish , , and are at the coordinates , , and , respectively. Thus, the action done at this time with catches all the fish.
Sample Input 2
3 10
100 100 100
1 10 30
10 20 10
Sample Output 2
100
One optimal choice is to do the action at time with .
Sample Input 3
4 10
1000 100 10
100 99 1
10 0 100
1 1 1
Sample Output 3
1110
One optimal choice is to do the action at time with .