#include using namespace std; #define MAX 1000006 vector V(MAX,0); bool fl[MAX]={0}; vector primes; void find_primes() { int i,j; for(i =2;i < MAX ; i++) { if(fl[i]==0) { primes.push_back(i); for(j=2;i*j a) { // Return the length of the longest possible sequence of moves. long sum=0; for(auto n:a) // for(long n=2;n<40;n++) { // cout<> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } find_primes(); long result = longestSequence(a); cout << result << endl; return 0; }