#include using namespace std; vector factorization(long n) { vector result; for (long i = 2; i * i <= n; i++) { if (n % i == 0) { while (n % i == 0) { n /= i; result.push_back(i); } } } if (n > 1) { result.push_back(n); } return result; } long longestSequence(vector a) { long result = 0; for(int i=0; i fac = factorization(a[i]); long part = 0; for(int j=0; j> 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; }