We have n ropes of equal length and we want to use them to lift a heavy object. Each rope has an associated tear-off weight t: if we try to lift an object heavier than t with that single rope, the rope tears off. However, we may fasten several ropes to the object in parallel and lift it with all of them together. When k ropes are used to lift an object of weight w, each of the k ropes -- regardless of its own tear-off weight -- is assumed to carry a weight of w/k. If w/k>t for a rope whose tear-off weight is t, that rope tears off.
For example, three ropes with tear-off weights 1, 10, and 15, when all three are fastened to one object, cannot lift an object heavier than 3 unless the weakest rope tears off; but the second rope alone can lift an object of weight at most 10.
Given the tear-off weights of the n ropes, find the weight of the heaviest object that can be lifted by fastening some subset of the ropes so that none of them tears off.
The first line contains a single integer t (1≤t≤10), the number of test cases, followed by the data for each test case. The first line of each test case contains a single integer n (1≤n≤1000), the number of ropes. The next line contains n integers between 1 and 10000, the tear-off weights of the ropes, separated by spaces.
For each test case, output on its own line a single number: the largest weight that can be lifted without tearing off any chosen rope.