#include using namespace std; int solve(vector A) { // Return the length of the longest possible sequence of moves modulo 10^9+7. int sum=0; vectorb; int m=A.size(); int k,i,j; for( k=0;k<=m-1;k++) { for(int i=0;i<=m-1-k;i++) { j=i+k; int max=-999999; for(int l=i;l<=j;l++) { if(maxc; m=b.size(); for(int k=0;k<=m-1;k++) { for(int i=0;i<=m-1-k;i++) { j=i+k; int max=-999999; for(int l=i;l<=j;l++) { if(max> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } int result=solve(a); cout << result << endl; return 0; }