37 lines
653 B
C++
37 lines
653 B
C++
#include <cstdio>
|
|
#include <iostream>
|
|
#include <stdlib.h>
|
|
#include <cmath>
|
|
|
|
|
|
int main() {
|
|
int t = 200000;
|
|
// std::scanf("%d", &t);
|
|
|
|
while (t--) {
|
|
int n;
|
|
// std::scanf("%d", &n);
|
|
|
|
n = std::rand() % 500000 + 1;
|
|
|
|
if (n == 1) {
|
|
std::cout << "0" << std::endl;
|
|
continue;
|
|
}
|
|
|
|
int total = 1;
|
|
int r = (int) std::floor(std::sqrt(n));
|
|
|
|
for (int n2 = 2; n2 < r + 1; n2++) {
|
|
if (n % n2 == 0)
|
|
total += n2 + (n/n2);
|
|
// std::cout << n2 << std::endl;
|
|
}
|
|
|
|
std::cout << total << std::endl;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|