1317. Empty cuboids

单点时限: 2.0 sec

内存限制: 256 MB

We call a cuboid regular if:

1.one of its vertices is a point with coordinates (0,0,0),

2.edges beginning in this vertex lay on positive semi-axes of the coordinate system,

3.the edges are not longer than 106

There is given a set A of points of space, which coordinates are integers from the interval [1..106]. We try to find a regular cuboid of maximal volume, which does not contain any of the points from the set A. A point belongs to the cuboid if it belongs to the inside of the cuboid, i.e. it is a point of the cuboid, but not of its wall.

Task

Write a program which:

1.reads coordinates of points from the set A,

2.finds one of the regular cuboids of maximal volume, which does not contain any points from the set A,

3.writes the result.

输入格式

In the first line of the input file PUS.IN one non-negative integer n, n <= 5000, is written. It is the number of elements in the set A. In the following n lines of the file PUS.IN there are triples of integers from the interval [1..106], which are coordinates (respectively x, y and z) of points from A. Numbers in each line are separated by single spaces.

输出格式

In the only line of the output file PUS.OUT there should be three integers separated by single spaces. These are coordinates (respectively x, y and z) of the vertex of the regular cuboid of maximal volume. We require that coordinates are positive.

样例

Input
4
3 3 300000
2 200000 5
90000 3 2000
2 2 1000
Output
1000000 200000 1000

0 人解决,2 人已尝试。

0 份提交通过,共有 13 份提交。

9.9 EMB 奖励。

创建: 17 年,3 月前.

修改: 7 年,2 月前.

最后提交: 13 年前.

来源: POI 1999 I Stage

题目标签