#include #include #include #include #include #include #include long int count(long int n) { if(n==1) return 1; if(n%2==0) { return n+count(n/2); } else { long int q=0; for(long int i=3;i<=sqrt(n);i+=2) if(n%i==0) { q=i; break; } if(q==0) return n+count(1); else return n+count(n/q); } } long int longestSequence(int n, long int* a) { long int rem=0; for(int i=0;i