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
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
	long long n, pier, wyn = 0, j, i, k;
	cin >> n;
	pier = sqrt(n);
	for(i = 1; i <= pier; ++i){
		if(n % i == 0)	 {
			for(k= 2; k < (n/i - 1- k) ; ++k){
				if( (n/i - 1 - k)%(k) == 0) {
				wyn +=1;	
				//cout << i <<" "<<k*i<<" "<<i*k*(n/i - 1- k)/k<<endl;
				}
			}
			j = n/i;
			for(k= 2; k < (i - 1- k) ; ++k){
				if( (i - 1 - k)%(k) == 0) {
				wyn +=1;	
				//cout << j <<" "<<k*j<<" "<<j*k*(i - 1- k)/k<<endl;
				}	
			}			
		}	
	}
	cout << wyn;


return 0;
}