Entries from 2019-05-11 to 1 day
cin >> s; found = s.find("AB"); while(found != string::npos){ cnt++; found = s.find("AB", found+1); }
int main() { long n; cin >> n; long result = 0; for (long i=2; i<=sqrt(n); i++) { if (n%i==0) { if (i==(n/i)) result += i; else result += (i + n/i); } } cout << result << endl; }