Advertisement
a53

dinamica02

a53
Oct 31st, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #define MOD 777013
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,a,b,c,i;
  8. cin>>n;
  9. a=26;
  10. b=26*26;
  11. if(n==1)
  12. {
  13. cout<<a<<'\n';
  14. return 0;
  15. }
  16. if(n==2)
  17. {
  18. cout<<b<<'\n';
  19. return 0;
  20. }
  21. for(i=3;i<=n;++i)
  22. c=25*(a+b)%MOD,a=b,b=c;
  23. cout<<c<<'\n';
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement