{"raw_statement":[{"iden":"statement","content":"In CCPC contests, you will get \"Time Limit Exceeded\" when your program tried to run during too much time. Setting suitable time limit for problems is vital to a contest.\n\nMr. Bread is preparing problems for a coming contest with his friends. For each problem, there will be a \"Main Correct Solution\" denotes the standard solution program written by the author. There will also be several \"Correct Solutions\" denote solution programs intended to pass.\n\nAssume there are $n$ programs in total, labeled by $1, 2, \\\\dots, n$. The $1$-th program denotes the \"Main Correct Solution\" while others are \"Correct Solutions\". The $i$-th program runs in $a_i$ seconds.\n\nAccording to the rules in Mr. Bread's mind, the time limit $x$ should meet all the rules below:\n\nPlease write a program to find the time limit $x$.\n\nThe first line of the input contains an integer $T (1 <= T <= 10)$, denoting the number of test cases.\n\nIn each test case, there is one integer $n (2 <= n <= 10)$ in the first line, denoting the number of programs.\n\nIn the second line, there are $n$ integers $a_1, a_2,..., a_n (1 <= a_i <= 10)$.\n\nFor each test case, print a single line containing an integer, denoting the value of $x$.\n\n"},{"iden":"input","content":"The first line of the input contains an integer $T (1 <= T <= 10)$, denoting the number of test cases.In each test case, there is one integer $n (2 <= n <= 10)$ in the first line, denoting the number of programs.In the second line, there are $n$ integers $a_1, a_2,..., a_n (1 <= a_i <= 10)$."},{"iden":"output","content":"For each test case, print a single line containing an integer, denoting the value of $x$."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ P, Q \\in \\mathbb{R}^2 $ be two fixed pivot points.  \nLet $ A = \\{A_1, A_2, \\dots, A_n\\} \\subset \\mathbb{R}^2 $ be a set of $ n $ distinct points, none lying on line $ \\overleftrightarrow{PQ} $.  \n\nFor any point $ A_i \\in A $, define the **orientation** relative to triangle $ \\triangle PQA_j $ as:  \n$ A_i $ is **inside** $ \\triangle PQA_j $ (excluding boundary) if it lies in the interior of the triangle formed by $ P, Q, A_j $.  \n\nA **nested triangle sequence** is a strictly increasing sequence of indices $ v_1 < v_2 < \\dots < v_k $ such that for all $ i \\geq 2 $, point $ A_{v_i} $ lies strictly inside triangle $ \\triangle P Q A_{v_{i-1}} $.  \n\n**Constraints**  \n1. $ 1 \\leq T \\leq 1000 $  \n2. For each test case:  \n   - $ 1 \\leq n \\leq 10^5 $  \n   - Coordinates of $ P, Q, A_i \\in [-10^9, 10^9] $  \n   - All points distinct; no $ A_i $ lies on line $ \\overleftrightarrow{PQ} $  \n   - Sum of $ n $ over all test cases $ \\leq 10^6 $  \n\n**Objective**  \nFind the **maximum length** $ k $ of a nested triangle sequence $ v_1, v_2, \\dots, v_k $, and among all such sequences of maximum length, return the **lexicographically smallest** one.  \n\nLexicographic minimality: For two sequences $ \\mathbf{v} = (v_1, \\dots, v_k) $ and $ \\mathbf{u} = (u_1, \\dots, u_k) $, $ \\mathbf{v} < \\mathbf{u} $ iff there exists $ i \\in \\{1, \\dots, k\\} $ such that $ v_j = u_j $ for all $ j < i $ and $ v_i < u_i $.","simple_statement":"Given points P and Q, and n other points A1 to An, find the longest sequence of points where each next point lies inside the triangle formed by P, Q, and the previous point (not on borders). Among all longest sequences, choose the one with smallest lexicographical order of indices.","has_page_source":false}