{"raw_statement":[{"iden":"statement","content":"In many contests, balloons are used to indicate to contestants the general state of the contest. Each time a team solves a problem, a balloon of a specific color is sent to the team and attached on or near their machine. As the contest progresses, the contest floor gradually fills up with a multi-colored display showing how various teams are doing in the contest.\n\nConsider a contest of n problems in which each problem is attached to a specific balloon color. You will be able to see the balloon color of a problem in the contest floor if at least one team solved it during the contest.\n\nYou are given the number of accepted solutions on each problem. Your task is to count how many different colors you will be able to see. Can you?\n\nThe first line contains an integer T (1 ≤ T ≤ 1000), in which T is the number of test cases.\n\nThe first line of each test case contains an integer n (1 ≤ n ≤ 20), in which n is the number of problems in the contest. \n\nThen a line follows containing n integers p1, p2, ..., pk (0 ≤ pi ≤ 100), in which pi is the number of accepted solutions on the ith problem.\n\nFor each test case, print a single line containing the number different colors will you be able to see in the contest's floor.\n\n"},{"iden":"input","content":"The first line contains an integer T (1 ≤ T ≤ 1000), in which T is the number of test cases.The first line of each test case contains an integer n (1 ≤ n ≤ 20), in which n is the number of problems in the contest. Then a line follows containing n integers p1, p2, ..., pk (0 ≤ pi ≤ 100), in which pi is the number of accepted solutions on the ith problem."},{"iden":"output","content":"For each test case, print a single line containing the number different colors will you be able to see in the contest's floor."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of queries.  \nFor each query $ i \\in \\{1, \\dots, n\\} $, let $ s_i \\in \\mathbb{Z}_{\\geq 0} $ denote the amount of Pokédollars Ash has.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10^5 $  \n2. $ 0 \\leq s_i \\leq 10^{18} $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nFor each $ s_i $, find the maximum integer $ k \\in \\mathbb{Z}_{\\geq 0} $ such that:  \n$$\n\\sum_{j=1}^{k} j \\leq s_i\n$$  \nThat is,  \n$$\n\\frac{k(k+1)}{2} \\leq s_i\n$$  \nSolve for the largest such $ k $.","simple_statement":"Given n queries, for each query with amount s, find the maximum number of distinct Pokémon dolls Ash can buy, where the doll with ID i costs i Pokédollars.","has_page_source":false}