#include using namespace std; vector primes(long n){ vector t; while(n%2==0){ t.push_back(2); n=n/2; } for (long i = 3; i <= sqrt(n); i = i+2) { while (n%i == 0) { t.push_back(i); n = n/i; } } if (n > 2) t.push_back(n); return t; } long longestSequence(vector a) { long sum=0; // Return the length of the longest possible sequence of moves. for(long i=0;i temp=primes(a[i]); long n=a[i]; sum+=a[i]; for(long i=0;i> 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; }