fork(1) download
  1. #include<bits/stdc++.h>
  2. #define M 100000007
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. ios::sync_with_stdio(false);
  8. cin.tie(NULL);
  9. long long int i,t,n;
  10. long long int store[500001];
  11. store[0]=1;
  12. store[1]=1;
  13. for(i=2;i<500001;i++)
  14. {
  15. store[i]=((store[i-2]%M)+(store[i-1]%M))%M;
  16. }
  17. cin>>t;
  18. while(t--)
  19. {
  20. cin>>n;
  21. cout<<store[n-1]<<"\n";
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 19016KB
stdin
5
1
2
3
4
5
stdout
1
1
2
3
5