fork download
  1. from math import *
  2. F = [0] * (10 ** 6 + 1)
  3. def init():
  4. F[0] = 0
  5. F[1] = 1
  6. for i in range( 2, 10 ** 6 + 1):
  7. F[i] = F[i - 1] + F[i - 2]
  8. F[i] %= (10 ** 9 + 7)
  9.  
  10.  
  11. if __name__ == '__main__':
  12. init()
  13. t = int(input())
  14. for i in range(t):
  15. n = int(input())
  16. print(F[n])
  17.  
  18.  
Success #stdin #stdout 0.47s 49228KB
stdin
6
5
13
10
14
8
11
stdout
5
233
55
377
21
89