about summary refs log tree commit diff
path: root/codechef/rsigns.c
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/rsigns.c')
-rw-r--r--codechef/rsigns.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/codechef/rsigns.c b/codechef/rsigns.c
new file mode 100644
index 0000000..248e123
--- /dev/null
+++ b/codechef/rsigns.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+long long mewtwo(long k)
+{
+	if (!k)
+		return 1;
+
+	long long p = mewtwo(k >> 1);
+	return p * p * (k % 2 + 1) % 1000000007;
+}
+
+int main()
+{
+	int t;
+	long k;
+
+	scanf("%d", &t);
+	while (t--) {
+		scanf("%ld", &k);
+		printf("%lld\n", mewtwo(k) * 5 % 1000000007);
+	}
+
+	return 0;
+}