Given an array A of size N, the task is to find the longest subsequence such that difference between adjacents is one.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer N denoting the size of array A.
The second line of each test case contains N space separated integers denoting elements of the array A[ ].
Print the length of the longest subsequence such that difference between adjacents is one. Print the answer for each test case in a new line.
1<= T <=100
1<= N <=1000
1<= A[ ] <=1000
10 9 4 5 4 8 6