import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines import itertools import numpy as np #dp[k][i]=max(dp[i][j]+1 if 0=a[None, :k])) dp[k, :k]=((dp[:k, :k]+1)*nuo).max(axis=1) return np.max(dp, axis=1) def solve(): n=int(readline()) a=np.array(readline().split(), np.int32) x=myon(a) y=myon(a[::-1])[::-1] print(np.max(x+y+1)) for _ in range(t): solve()