#P1720D1. Xor-Subsequence (easy version)

    ID: 861 Type: RemoteJudge 2000ms 512MiB Tried: 0 Accepted: 0 Difficulty: 6 Uploaded By: Tags>bitmasksbrute forcedpstringstreestwo pointers*1800

Xor-Subsequence (easy version)

Description

It is the easy version of the problem. The only difference is that in this version ai200a_i \le 200.

You are given an array of nn integers a0,a1,a2,an1a_0, a_1, a_2, \ldots a_{n - 1}. Bryap wants to find the longest beautiful subsequence in the array.

An array b=[b0,b1,,bm1]b = [b_0, b_1, \ldots, b_{m-1}], where 0b0<b1<<bm1<n0 \le b_0 < b_1 < \ldots < b_{m - 1} < n, is a subsequence of length mm of the array aa.

Subsequence b=[b0,b1,,bm1]b = [b_0, b_1, \ldots, b_{m-1}] of length mm is called beautiful, if the following condition holds:

  • For any pp (0p<m10 \le p < m - 1) holds: abpbp+1<abp+1bpa_{b_p} \oplus b_{p+1} < a_{b_{p+1}} \oplus b_p.

Here aba \oplus b denotes the bitwise XOR of aa and bb. For example, 24=62 \oplus 4 = 6 and 31=23 \oplus 1=2.

Bryap is a simple person so he only wants to know the length of the longest such subsequence. Help Bryap and find the answer to his question.

The first line contains a single integer tt (1t1051 \leq t \leq 10^5)  — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer nn (2n31052 \leq n \leq 3 \cdot 10^5) — the length of the array.

The second line of each test case contains nn integers a0,a1,...,an1a_0,a_1,...,a_{n-1} (0ai2000 \leq a_i \leq 200) — the elements of the array.

It is guaranteed that the sum of nn over all test cases does not exceed 31053 \cdot 10^5.

For each test case print a single integer — the length of the longest beautiful subsequence.

Input

The first line contains a single integer tt (1t1051 \leq t \leq 10^5)  — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer nn (2n31052 \leq n \leq 3 \cdot 10^5) — the length of the array.

The second line of each test case contains nn integers a0,a1,...,an1a_0,a_1,...,a_{n-1} (0ai2000 \leq a_i \leq 200) — the elements of the array.

It is guaranteed that the sum of nn over all test cases does not exceed 31053 \cdot 10^5.

Output

For each test case print a single integer — the length of the longest beautiful subsequence.

Sample Input 1

3
2
1 2
5
5 2 4 3 1
10
3 8 8 2 9 1 6 2 8 3

Sample Output 1

2
3
6

Note

In the first test case, we can pick the whole array as a beautiful subsequence because 11<201 \oplus 1 < 2 \oplus 0.

In the second test case, we can pick elements with indexes 11, 22 and 44 (in 00-indexation). For this elements holds: 22<412 \oplus 2 < 4 \oplus 1 and 44<124 \oplus 4 < 1 \oplus 2.