66 lines
1.3 KiB
C
66 lines
1.3 KiB
C
#include <stdio.h>
|
|
|
|
unsigned int mul_count = 0;
|
|
|
|
int mul(int a, int b) {
|
|
mul_count++;
|
|
return a * b;
|
|
}
|
|
|
|
int main() {
|
|
for (int a = 0; a < 2; a++) {
|
|
int b = 0, c = 0, d = 0, e = 0, f = 0, g = 1, h = 0;
|
|
b = 67;
|
|
c = b;
|
|
if (a != 0) {
|
|
b = mul(b, 100);
|
|
b += 100000;
|
|
c = b;
|
|
c += 17000;
|
|
}
|
|
|
|
while (1) {
|
|
f = 1;
|
|
d = 2;
|
|
|
|
while (g != 0)
|
|
{
|
|
e = 2;
|
|
while (g != 0) {
|
|
if (b % d == 0) {
|
|
int e_required = b / d;
|
|
if (e_required >= 2 && e_required <= b) {
|
|
f = 0;
|
|
}
|
|
}
|
|
mul_count += (b - e);
|
|
g = 0;
|
|
}
|
|
|
|
d += 1;
|
|
g = d;
|
|
g -= b;
|
|
}
|
|
|
|
if (f == 0) {
|
|
h += 1;
|
|
}
|
|
|
|
g = b;
|
|
g -= c;
|
|
if (g != 0) {
|
|
b += 17;
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
if (a == 0) {
|
|
printf("%d\n", mul_count);
|
|
} else {
|
|
printf("%d\n", h);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|