fork(1) download
  1. def power(m,n,x):
  2. if(n==0):
  3. return 1
  4. if(n==1):
  5. return m
  6. temp=power(m,n/2,x)
  7. if n%2 == 0:
  8. return (temp%x*temp%x)%x
  9. else:
  10. return (m*temp%x*temp%x)%x
  11. t=int(input())
  12. g=1298074214633706835075030044377087
  13. while(t):
  14. t=t-1
  15. p=int(input())
  16. print (power(2,p+1,g)-1)%g
Success #stdin #stdout 0.01s 7856KB
stdin
3
0
1
2
stdout
1
3
7