logo AlgoBeat OnlineJudge
登录 注册

#212625. [UTS 2024] Jobs

内存限制:512 MiB 时间限制:800 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You are given a set of points with integer coordinates. Each point has its own weight.

We can split the plane using a point of coordinates into four dials by drawing the vertical line in and the horizontal line in . We define the weight of a dial to be the sum of the weights of all the points in that dial. Furthermore, the of such a split is the maximum difference between the weight of two of its dials.

For each integer such that , find the minimum imbalance of a split that uses a point on the vertical line .

输入格式

The first line contains an integer ().

Each of the next lines contains three integers , , and (, ) --- the coordinates and weight of the -th point.

输出格式

The only line of the output should contain integers, the required minimum imbalances.

样例

样例输入 1

4
3 2 5
4 4 2
1 4 4
2 2 1

样例输出 1

6
4
6

数据范围与提示

  • ( points): ;
  • ( points): ;
  • ( points): ;
  • ( points): no further restrictions.