A. Three Indices
A. Three Indices
time limit per test
2 secondsmemory limit per test
256 megabytesinput
standard inputoutput
standard outputYou are given a permutation . Recall that sequence of integers is called a permutation if it contains all integers from to exactly once.
Find three indices , and such that:
- ;
- and .
Input
The first line contains a single integer () — the number of test cases.
Next lines contain test cases — two lines per test case. The first line of each test case contains the single integer () — the length of the permutation .
The second line contains integers (; if ) — the permutation .
Output
For each test case:
- if there are such indices , and , print YES (case insensitive) and the indices themselves;
- if there are no such indices, print NO (case insensitive).
If there are multiple valid triples of indices, print any of them.
Example
input
Copy
3 4 2 1 4 3 6 4 6 1 2 5 3 5 5 3 1 2 4
output
Copy
YES 2 3 4 YES 3 5 6 NO
Comments
Post a Comment
Please give us your valuable feedback