blob: 0fcd69e110ce01adf8bebfab59fc0f3e30f517d7 (
plain) (
tree)
|
|
#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;
}
|