Skip to content

Instantly share code, notes, and snippets.

@avamsi
Last active August 29, 2015 14:09
Show Gist options
  • Save avamsi/04bd3f8ef7787fb06397 to your computer and use it in GitHub Desktop.
Save avamsi/04bd3f8ef7787fb06397 to your computer and use it in GitHub Desktop.
mod = 1000000007
pre = [1]
for _ in xrange(100000):
pre.append(2*pre[-1] % mod)
for t in xrange(1, int(raw_input()) + 1):
n = int(raw_input()) - 1
if n:
print 'Case {0}: {1}'.format(t, (n + 2)*pre[n - 1] % mod)
else:
print 'Case {0}: 1'.format(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment