#abc274f. F - Fishing
F - Fishing
Score : points
问题描述
在数轴上,有 条鱼在游动。
第 条鱼的重量为 ,在时间 时刻位于坐标 处,并以速度 向正方向移动。
高桥将选择一个大于等于 的任意实数 ,并在时间 仅执行一次以下动作:
动作:选择一个任意实数 。捕获所有坐标位于 和 (包含两端点)之间的鱼。
请找出他能捕获的最大总重量的鱼。
以上为通义千问 qwen-max 翻译,仅供参考。
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 .
update @ 2024/3/10 11:33:14