From 9e3cdb5da0b4fc1ff3b0fca15b4118785aebe026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Fri, 13 Jan 2023 17:25:46 +0100 Subject: =?UTF-8?q?=C5=A1olsko=20ra=C4=8Dunalni=C5=A1ko=20tekmovanje=20zot?= =?UTF-8?q?ks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inf/zotks/1.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 inf/zotks/1.c (limited to 'inf/zotks/1.c') 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 +#include +#include +#include +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; +} -- cgit v1.2.3