C. Paper Planes
Monocarp has folded n paper planes. The i-th of them flies exactly ai meters.
He is going to launch all n planes from the roof, one after another, in any order he likes. A launch is spectacular if the plane lands strictly farther than every plane launched before it. In particular, the first launch is always spectacular.
Before the launches, Monocarp may refold planes. To refold a plane with range x ≥ 2, he folds it once more, and its range becomes ⌊x / 2⌋. A plane can be refolded any number of times.
What is the maximum number of spectacular launches Monocarp can get?
Input
Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 104). The description of the test cases follows.
The first line of each test case contains a single integer n (1 ≤ n ≤ 2·105) — the number of planes.
The second line contains n integers a1, a2, …, an (1 ≤ ai ≤ 109) — the ranges of the planes.
It is guaranteed that the sum of n over all test cases does not exceed 2·105.
Output
For each test case, print a single integer — the maximum number of spectacular launches.
Examples
352 2 2 5 943 3 3 367 7 6 6 2 2
425
231000000000 1000000000 100000000011
31
Note
In the first test case, Monocarp can refold one of the planes with range 2. The ranges become [2, 1, 2, 5, 9], and if he launches the planes in the order 1, 2, 5, 9, 2, the first four launches are spectacular. Three planes of range 2 can only end up with ranges 2 and 1, so five spectacular launches are impossible.
In the second test case, every range can only become 3 or 1, so the answer is 2.