#include //#include using namespace std; //using namespace atcoder; using ll = long long; using ld = long double; #define all(s) (s).begin(),(s).end() #define vcin(n) for(ll i=0;i>n[i] #define rever(vec) reverse(vec.begin(), vec.end()) #define sor(vec) sort(vec.begin(), vec.end()) #define fi first #define se second #define SIZE(n) int(n.size()) #define P pair //const ll mod = 998244353; const ll mod = 1000000007; const ll inf = 2000000000000000000ll; static const long double pi = 3.141592653589793; template void chmax(T& t,const U& u){if(t void chmin(T& t,const U& u){if(t>u) t=u;} ll modPow(ll a, ll n, ll modulo) { ll ret = 1; ll p = a % modulo; while (n) { if (n & 1) ret = ret * p % modulo; p = p * p % modulo; n >>= 1; } return ret; } bool check(ll a,ll b,ll c){ if((a-b)*(c-b)>0&&a!=c&&b!=c&&a!=b){ return true; } return false; } void solve(){ ll n; cin>>n; vector a(n); vcin(a); vector t(n); vector b(2*n); for(int i=0;i dp(n+3,0); ll m=0; for(int i=0;i=2){ chmax(m,dp[i-2]); } } ll ans=0; for(int i=0;i>a; while(a--){ solve(); } }