← Home
write a go solution for Description:
It is the easy version of the problem. The only difference is that in this version a_i<=200.

You are given an array of n integers a_0,a_1,a_2,ldotsa_n-1. Bryap wants to find the longest beautiful subsequence in the array.

An array b=[b_0,b_1,ldots,b_m-1], where 0<=b_0<b_1<ldots<b_m-1<n, is a subsequence of length m of the array a.

Subsequence b=[b_0,b_1,ldots,b_m-1] of length m is called beautiful, if the following condition holds:

- For any p (0<=p<m-1) holds: a_b_poplusb_p+1<a_b_p+1oplusb_p.

Here aoplusb denotes the bitwise XOR of a and b. For example, 2oplus4=6 and 3oplus1=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.

Input Format:
The first line contains a single integer t (1<=t<=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 n (2<=n<=3*10^5) — the length of the array.

The second line of each test case contains n integers a_0,a_1,...,a_n-1 (0<=a_i<=200) — the elements of the array.

It is guaranteed that the sum of n over all test cases does not exceed 3*10^5.

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

Note:
In the first test case, we can pick the whole array as a beautiful subsequence because 1oplus1<2oplus0.

In the second test case, we can pick elements with indexes 1, 2 and 4 (in 0-indexation). For this elements holds: 2oplus2<4oplus1 and 4oplus4<1oplus2.. Output only the code with no comments, explanation, or additional text.