about summary refs log tree commit diff
path: root/codechef/fibeasy.c
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-09-16 20:32:51 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-09-16 20:32:51 +0700
commit4b8df7227736b7c41af56e053d40decc309fe7f9 (patch)
tree9d2823886c29ddd3ac8cd8a5503ad130238d012e /codechef/fibeasy.c
parent029688e143109344989b1529259e391822abb0aa (diff)
downloadcp-4b8df7227736b7c41af56e053d40decc309fe7f9.tar.gz
Recovery (2010)
Diffstat (limited to 'codechef/fibeasy.c')
-rw-r--r--codechef/fibeasy.c23
1 files changed, 23 insertions, 0 deletions
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 <stdio.h>
+
+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;
+}