From 4b8df7227736b7c41af56e053d40decc309fe7f9 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Mon, 16 Sep 2019 20:32:51 +0700 Subject: Recovery (2010) --- codechef/fibeasy.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 codechef/fibeasy.c (limited to 'codechef/fibeasy.c') diff --git a/codechef/fibeasy.c b/codechef/fibeasy.c new file mode 100644 index 0000000..d5309a5 --- /dev/null +++ b/codechef/fibeasy.c @@ -0,0 +1,23 @@ +#include + +const char LAST[] = "0923"; + +int main() +{ + int t, c; + long n; + + scanf("%d", &t); + while (t--) { + scanf("%ld", &n); + if (n == 2 || n == 3) { + puts("1"); + continue; + } + + for (c = 0; n >>= 1; c++); + printf("%c\n", LAST[c % 4]); + } + + return 0; +} -- cgit 1.4.1