#include #include #include #include #include using namespace std; vector di; long long pSolMax = 0; void printDivisors(long long n){ for (long long i=1; i<=sqrt(n)+1; i++){ if (n%i==0){ if (n/i == i){ //printf("%d ", i); di.push_back(i); } else{ //printf("%d %d ", i, n/i); vector::iterator fd = find(di.begin(), di.end(), i); if(fd == di.end()){ di.push_back(i); di.push_back(n/i); } } } } } void partSol(long long start, long long val, long long cnt, long sz, long cIn){ for(long tIn = cIn+1; tIn::iterator it = di.begin(); for(it++; it!=(di.end()-1); it++){ long long start = *it; long long pSol = start; //cout<<"start: "<::iterator fd = find(di.begin(), di.end(), start); if(fd != di.end() && start> n; vector a(n); long long sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n; i++) { if(a[i] == 1){ sum++; } //else if(a[i]%2 == 1){ //sum = sum + a[i]+1; //} else{ printDivisors(a[i]); sort(di.begin(), di.end()); sum = sum + a[i]+1; sum = sum + calc(a[i]); di.clear(); pSolMax = 0; } } cout<