Advertisement
Saleh127

hackerearcth fight3

Sep 28th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. ll a,c,d,e,f,i,j,k,l=1e9+7;
  11. ll fiv[1000];
  12. fiv[1]=2;
  13. fiv[2]=2;
  14. for(i=3;i<=105;i++)
  15. {
  16. fiv[i]=(fiv[i-1]+fiv[i-2])%l;
  17. }
  18. test
  19. {
  20. cin>>a;
  21. cout<<fiv[a]<<endl;
  22. }
  23. return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement