13535 - special subsequence   

Description

Given a sequence A = a1, a2, ..., aN.

A continuous subsequence A[L ... R] = aL, ..., aR of  A is called special if for every i, j in [L, R], a[ i ] * 2 ≠ a[ j ].

For example, if A = 3, 1, 4, 6, 2.

Then

  • A[1, 3] = 3, 1, 4 is special.
  • A[1, 4] = 3, 1, 4, 6 is not special because a[1] * 2 = a[4].
  • A[2, 5] = 1, 4, 6, 2 is not special because a[5] * 2 = a[3] and a[2] * 2 = a[5].

 

Please find the maximum length of every special contiguous subsequence of A.

 

Input

The first line of the input contains a number T — the number of test cases.

The first line of each test case contains a positive integer N — the length of A.

The second line of each test case contains N positive integers — a1a2, ..., aN.

 

For each test,

  1. T ≤ 10, N ≤ 103, ai ≤ 109 
  2. T ≤ 10, N ≤ 103, ai ≤ 109 
  3. T ≤ 10, N ≤ 103, ai ≤ 109 
  4. T ≤ 10, N ≤ 105, ai ≤ 109 
  5. T ≤ 10, N ≤ 105, ai ≤ 109 
  6. T ≤ 10, N ≤ 105, ai ≤ 109 

 

Output

For each test case, print the maximum length of special contiguous subsequence.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss