#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x=0) return ret; ret=2; if(A[L]>A[R]) { for(i=L+1;iA[L]) ret=max(ret,1+dodo(L,i)); } else { for(i=L+1;iA[R]) ret=max(ret,1+dodo(i,R)); } return ret; } void solve() { int i,j,k,l,r,x,y; string s; cin>>N; FOR(i,N) cin>>A[i]; int ma=1; MINUS(memo); FOR(y,N) FOR(x,y) ma=max(ma,dodo(x,y)); cout<