include stdio include math long long divider long long int for sqrt if

 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
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <math.h>
long long divider(long long a){
int i, k = 0 ;
for (i = 1; i <= sqrt(a); i++ ){
if (a % i == 0 ){
k += 1;
}
}
if ( sqrt(a) * sqrt(a) == a ){
return 2*k - 1;
}
return 2*k;
}
int main(int argc, char **argv){
long long j = 1 , i = 1, kol = 1, temp = 0 ;
while ( 1 ){
temp = divider((j+1)/2);
kol = divider(j) * temp;
if ( kol >= 3000){
break;
}
j ++;
kol = temp * divider(j+1);
if ( kol >= 3000){
break;
}
j ++;
}
printf ("\tchislo %lld \n\tdeliteli %lld\n\n",j*(j+1)/2,kol);
return 0;
}