#include using namespace std; #define MAXN 10001 int n; vector< pair > ret; void factors(long x) { long i = 1; while(i*i <= x) { if(x % i == 0) { ret.push_back(make_pair(i,1)); if(x/i != i) { ret.push_back(make_pair(x/i,1)); } } i++; } } long longestSequence(vector a) { long res=0; // Return the length of the longest possible sequence of moves. for(size_t i = 0; i=0;a--){ for(long b=0;b> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = longestSequence(a); cout << result << endl; return 0; }