#include #include #include int main() { int t; std::scanf("%d", &t); while (t--) { int n; std::scanf("%d", &n); 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) { int other = n / n2; if (other != n) total += other; total += n2; } } std::cout << total << std::endl; } return 0; }