summaryrefslogtreecommitdiffstats
path: root/inf/zotks/1.c
blob: 0fcd69e110ce01adf8bebfab59fc0f3e30f517d7 (plain) (blame)
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
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <signal.h>
int main (void) {
	char buf[256];
	unsigned long long prev = 0;
	unsigned long long d;
	unsigned long long numl = 0;
	unsigned long long a1;
	while (1) {
		fgets(buf, 256, stdin);
		if (ferror(stdin) || feof(stdin))
			break;
		numl++;
		unsigned long long cur = strtoull(buf, NULL, 10);
		if (numl == 1)
			a1 = cur;
		if (numl == 2)
			d = cur-prev;
		prev = cur;
	}
	printf("%llu\n", (prev-a1)/d+1-numl);
	return 0;
}