#include using namespace std; class Compare { public: bool operator()(pair lhs, pair rhs) { return lhs.second < rhs.second; } }; pair getPrime(long n) { priority_queue, vector>, Compare> p; int count =0; while((n%2)==0) { count++; n /= 2; } if(count) p.push(make_pair(2, count)); count =0; for (int i=3; i<= sqrt(n); i+=2) { while((n%i)==0) {count++;n /= i;} if(count) p.push(make_pair(i, count)); count =0; } if(n>2) p.push(make_pair(n, 1)); return p.top(); } long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. long total =0; int standard [] = {0, 1, 3, 4, 7, 6, 10, 8, 13,13, 16}; for (int i=0; i res = getPrime(a[i]); //cout <> 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; }