#include using namespace std; typedef unsigned long long int ulli; ulli longestSequence(vector a) { // Return the length of the longest possible sequence of moves. ulli i11,fact, res1=0, res11, moves_n_level=1,a_temp; vector ::iterator i1; for(i1=a.begin(); i1 !=a.end(); i1++) { res11=(*(i1) !=1)?1:0; a_temp=*i1; //cout<<"a_temp "<1 && fact!=1) { i11=sqrt(a_temp); //cout<=1 && fact!=1); i11--) { if(a_temp%i11==0)//finding largest factor of a_temp { fact=i11; a_temp/=i11; moves_n_level*=i11; res11+=moves_n_level; //cout<<"\nfactor="<> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; //cout<< a[a_i]<<" "; } //cout<<"\n"; ulli result = longestSequence(a); cout << result << endl; return 0; }