410734: GYM104094 J Pyramid Construction

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Pyramid Constructiontime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

As you might know, the Egyptian pyramids are one of the most famous wonders of the world. They were built by aliens in ancient times. The alien Ar'glh flies past Earth to work and back every day and he often makes a stop to admire these magnificent structures and find inspiration.

You see, Ar'glh is an architect and is designing his own pyramid. Fortunately, with the new technology, he doesn't need huge blocks of stone or the countless Egyptian workers' labor. But that still doesn't mean that his task is easy.

Over the past centuries, Ar'glh has assembled $$$n$$$ carbon triangular facets, the $$$i$$$-th of them has sides of length $$$a_i$$$, $$$b_i$$$, and $$$c_i$$$, respectively. He wants to choose four facets and assemble a pyramid in the shape of a non-degenerate tetrahedron with them. Of course, the facets must fit together perfectly without any deformations or gaps and must not protrude beyond the tetrahedron. The volume of the tetrahedron must be strictly positive.

Help the alien architect determine which four facets he can choose from his set to assemble a pyramid in the shape of a tetrahedron.

Input

The first line containts an integer $$$n$$$ — the number of triangular facets available to Ar'glh ($$$4 \leq n \leq 1500$$$).

The $$$i$$$-th of the following $$$n$$$ lines contains three integers $$$a_i$$$, $$$b_i$$$, and $$$c_i$$$ — the lengths of the sides of the $$$i$$$-th facet ($$$1 \leq a_i, b_i, c_i \leq 10\,000$$$, it is guaranteed that each facet is a valid triangle, i.e. $$$a_i + b_i > c_i$$$, $$$a_i + c_i > b_i$$$, $$$b_i + c_i > a_i$$$).

Output

If Ar'glh can choose four facets from which a tetrahedron can be assembled, the first line must contain the word "Yes". In this case the second line must contain four different integers from $$$1$$$ to $$$n$$$ — the numbers of facets that can be used to build. If there are several possible answers, print any of them.

Otherwise, print the word "No".

ExamplesInput
7
3 3 3
3 4 5
4 5 6
3 4 3
3 3 5
6 5 7
3 5 5
Output
Yes
2 4 5 7
Input
5
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
Output
No
Input
4
2 3 4
3 4 2
3 2 4
4 2 3
Output
No

加入题单

上一题 下一题 算法标签: