1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>

int getDivisors(int r);

using namespace std;

int main() {
    int n;
    cin >> n;
    int result = 0;
    int d = 1;
    while (d * d < n) {
        if (n % d == 0) {
            result += getDivisors(d - 1);
            result += getDivisors(n / d - 1);
        }
        d++;
    }
    if (d * d == n) {
        result += getDivisors(d - 1);
    }
    cout << result << endl;

    return 0;
}

int getDivisors(int r) {
    int result = 0;
    if (r % 2 == 0 && r / 2 >= 3) {
        result++;
    }
    int d = 3;
    while (d * d < r) {
        if (r % d == 0 && r / d >= 3) {
            result += 2;
        }
        d++;
    }
    if (d * d == r) {
        result++;
    }
    return result;
}