Nearest Angle

All submissions for this problem are available.
###Read problems statements in [Russian](http://www.codechef.com/download/translated/S19PETST/russian/ANGLE.pdf), [Vietnamese](http://www.codechef.com/download/translated/S19PETST/vietnamese/ANGLE.pdf), [Hindi](http://www.codechef.com/download/translated/S19PETST/hindi/ANGLE.pdf), [Mandarin chinese](http://www.codechef.com/download/translated/S19PETST/mandarin/ANGLE.pdf) and [Bengali](http://www.codechef.com/download/translated/S19PETST/bengali/ANGLE.pdf) as well. You are given a sequence of positive integers $A_1, A_2, \ldots, A_N$. You must choose three elements $A_x, A_y, A_z$ ($x$, $y$, $z$ should be pairwise distinct) such that there is a nondegenerate triangle $\mathsf{XYZ}$ with the following properties:  $\mathsf{XY} = A_z$, $\mathsf{XZ} = A_y$, $\mathsf{YZ} = A_x$  the angle $\angle \mathsf{YXZ} = \theta$ satisfies $\cos\theta \ge P/Q$ In addition, the angle $\theta$ should be maximum possible. Find any such triangle or determine that it does not exist. ### Input  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first line of each test case contains three spaceseparated integers $N$, $P$ and $Q$.  The second line contains $N$ spaceseparated integers $A_1, A_2, \ldots, A_N$. ### Output If there is no solution, print a single line containing one integer $1$. Otherwise, print a single line containing three spaceseparated integers $x$, $y$ and $z$. If there are multiple possible solutions, you may output any one. ### Constraints  $1 \le T \le 5$  $1 \le N \le 1,000$  $1 \le A_i \le 10,000$ for each valid $i$  $1 \le Q \le 10,000$  $P \lt Q$ ### Example Input ``` 2 4 1 2 6 6 6 7 3 5 7 1 3 8 ``` ### Example Output ``` 1 2 3 1 ```Author:  kingofnumbers 
Editorial  https://discuss.codechef.com/problems/ANGLE 
Tags  binarysearch, easymedium, kingofnumbers, snckpe19, taran_1407, trigonometry 
Date Added:  23052018 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions