summaryrefslogtreecommitdiffstats
path: root/inf/zotksd/3.c
diff options
context:
space:
mode:
Diffstat (limited to 'inf/zotksd/3.c')
-rw-r--r--inf/zotksd/3.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/inf/zotksd/3.c b/inf/zotksd/3.c
new file mode 100644
index 0000000..b7723b1
--- /dev/null
+++ b/inf/zotksd/3.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#define ABS(x) ((x) > 0 ? (x) : -(x))
+#define N unsigned long long int
+int main (void) {
+ char buf[512];
+ fgets(buf, 512, stdin);
+ N n = strtoull(buf, NULL, 10);
+ N num = 0;
+ for (N i = 1; i < ceill(sqrtl(n)); i++) {
+ if (n % i)
+ continue;
+ if (ABS(i-n/i) % 2)
+ continue;
+ num++;
+#ifndef EVAL
+ fprintf(stderr, "(%llu, %llu)\n", i, n/i);
+#endif
+ }
+ printf("%llu\n", num);
+}