summaryrefslogtreecommitdiffstats
path: root/inf/zotksd/3.c
blob: b7723b1ee7c19d805be03b28d4ca662f4f8c54ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}