#include #include using namespace std; #include #include #include #include #include #include #include #include #include #define MOD1 1000000007 #define MOD2 998244353 #define LIMIT1 200010 #define LIMIT2 500010 #define LIMIT3 1000010 #define INF ((1<<30)-1) #define LLINF (1LL<<60) #define EPS (1e-10) typedef long long ll; typedef long double ld; typedef const void cv; typedef pair P; #define rep(i,n) for((i)=0;(i)<(n);(i)++) #define per(i,n) for((i)=(n)-1;(i)>=0;(i)--) template T max(T a,C b){ return ((a)>(T)(b) ? (a) : (T)(b)); } template T min(T a,C b){ return ((a)<(T)(b) ? (a) : (T)(b)); } #define zt(a,b) (max((a),(b))-min((a),(b))) #define setpre(n) fixed << setprecision(n) ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} int dx[8]={1,0,-1,0,1,-1,-1,1},dy[8]={0,1,0,-1,1,1,-1,-1}; int upint(cv *a, cv *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; } int downint(cv *a, cv *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; } int upchar(cv *left, cv *right) {return strcmp((char *)left,(char *)right);} int downchar(cv *left, cv *right) {return strcmp((char *)right,(char *)left);} ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1){ res *= a; if(mod>=1) res %= mod; } a *= a; if(mod>=1) a %= mod; n >>= 1; } return res; } void initialize(){ } int a[LIMIT2]={0}; int dp[30]={0}; int main(void){ initialize(); int n,m,i,j,k,result=0; string s; cin >> n; rep(i,n) cin >> a[i]; dp[0]=0; for(i=1;i<20;i++) dp[i]=-9999999; rep(i,n){ per(j,10){ //cout << i <<" "<