summaryrefslogtreecommitdiffstats
path: root/inf/zotks/1.c
diff options
context:
space:
mode:
Diffstat (limited to 'inf/zotks/1.c')
-rw-r--r--inf/zotks/1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/inf/zotks/1.c b/inf/zotks/1.c
new file mode 100644
index 0000000..0fcd69e
--- /dev/null
+++ b/inf/zotks/1.c
@@ -0,0 +1,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;
+}