#include using namespace std; unsigned nChoosek( unsigned n, unsigned k ) { if (k > n) return 0; if (k * 2 > n) k = n-k; if (k == 0) return 1; int result = n; for( int i = 2; i <= k; ++i ) { result *= (n-i+1); result /= i; } return result; } int factorial (int N) { int fact = 1; for( int i=1; i<=N; i++ ) fact = fact * i; // OR fact *= i; return fact; } long long perm(int n, int k) { return factorial(n) / factorial(n-k); } int main(){ int n; cin >> n; vector m(n); vector v2; v2 = m; for(int m_i = 0; m_i < n; m_i++){ cin >> m[m_i]; } int l = 0; int min = 1400; for(int m_i = 1; m_i < n; m_i++){ if(m[m_i] > m[m_i-1]) l ++; else if (l < min) min = l; } if (l < min) min = l; cerr << min; //Only one way for a one vector collection long long t = 1; for (int i = 2; i < min +1; i++ ) { int idx = 0; int level_num = 0; while (idx < n - 1) { bool good = true; for (int j = 0; j < i-1; j++) { idx ++; if (m[idx-1] > m[idx]) { good = false; break; } } idx ++; if (good) level_num ++; } if ((n % i) == 1) level_num ++; int add = 1; for (int j = 1; j < level_num; j++) { int c = i; if ((n - i * j)