HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2009.G. 50260 - What about judges?

Guest
• Discussion of problem (1)

Volume problems

• 2008.G. 50264 - String Multiplication
• 2008.H. 50254 - Lawyers Council
• 2009.A. 50283 - Tetris 3D
• 2009.B. 50284 - Knights of the Rook
• 2009.C. 50285 - Meat store
• 2009.D. 50259 - Many-coloured roads
• 2009.E. 50266 - Kovrov
• 2009.F. 50267 - Interesting permutat...
• 2009.G. 50260 - What about jud...
• 2009.H. 50268 - Triangles
• 2009.I. 50278 - ATM
• 2010.A. 50287 - Providers
• 2010.B. 50281 - Primes
• 2010.D. 50277 - Unusual Lottery
• 2010.E. 50664 - Polygons
• 2010.F. 50265 - Liars and Knights
• 2010.G. 50256 - Sequence

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 3000/6000/6000/6000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Павел Кузнецов, ПГУ.

In order to check team's solutions in automatic mode, the problem authors have to write a checker, besided the statements and the tests. In case when there are several correct answers, the checker cannot just compare the team answer with correct answer.

Your task is to help the authors of "Interesting permutations" problem and write the checker for it. In other words, you are given a permutation of N numbers and you must find out whether it is interesting or not.

As a reminder, according to the statement of the "Interesting permutations" problem, a permutation is called interesting if it does not contain 3 numbers that make an arithmetic progression. For example, permutations 2, 1, 3 and 4, 2, 3, 1 are interesting. On the contrary, permutation 5, 1, 2, 4, 3 is not interesting, since it contains numbers 1, 2, 3 that make an arithmetic progression. It does not matter that there is a number 4 between 2 and 3. The ascending or descending order of numbers is all that matters. Also you can take 5, 4, 3, since these numbers also make the arithmetic progression.

Input
The first line contains a single integer N (3 ≤ N ≤ 100000). The next line contains N numbers of permutation. Numbers are separated by spaces.
Output
Output a single word "YES" (capital letters and no quotes), if the permutation is interesting. Otherwise, the first line should contain the word "NO" (capital letters and no quotes). The second line should contain three numbers - positions of elements, that make the arithmetic progression. Positions are numbered from 1 to N. Positions should be in ascending order. If there are several answers, you may output any of them.

Input 1 Output 1
5
3 2 4 5 1
NO
1 3 4
Input 2 Output 2
5
3 1 5 2 4
YES

Для отправки решений необходимо выполнить вход.

www.contester.ru