import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines t=int(readline()) dp=[[[0]*100 for i in range(100)] for j in range(2)] def solve(): n=int(readline()) a=list(map(int, readline().split())) for i in range(n): for j in range(i): dp[0][j][i]=0 dp[1][j][i]=0 ans=1 for i in range(n): for j in range(i): if a[j]a[i] and dp[1][j][i]==0: dp[1][j][i]=2 if ans0: for k in range(i+1, n): if a[i]-a[j]a[k] and dp[1][i][k]0: for k in range(i+1, n): if a[i]>a[k] and a[j]-a[i]>a[i]-a[k] and dp[1][i][k]