include [HTML_REMOVED]
using namespace std;
const int N = 101;
int f[N];
int a[N];
int main()
{
int t;
cin >> t;
while (t–)
{
int n;
memset(f, 0, sizeof(f));
cin >> n;
for (int i = 1; i <= n; i)
cin >> a[i];
int res = 0;
for (int i = 1; i <= n; i)
{
f[i] = 1;
for (int j = 1; j <= i; j)
if (a[i] > a[j]) f[i] = max(f[i], f[j] + 1);
}
for (int i = 1; i <= n; i)
res = max(res, f[i]);
for (int i = n; i >= 1; i–)
{
f[i] = 1;
for (int j = n; j >= i; j–)
if (a[i] > a[j]) f[i] = max(f[i], f[j] + 1);
}
for (int i = 1; i <= n; i++)
res = max(res, f[i]);
cout << res << endl;
}
return 0;
}