Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define P 301104
- using namespace std;
- ifstream fin("bilean.in");
- ofstream fout("bilean.out");
- int main()
- {
- int a, b, c, i, n;
- fin>>n;
- a=2;
- b=3;
- if(n==1)
- {
- fout<<a<< "\n";
- return 0;
- }
- if(n==2)
- {
- fout<< b<< "\n";
- return 0;
- }
- for(i=3; i<=n; i++)
- {
- c=(a+b)%P;
- a=b;
- b=c;
- }
- fout<<b<< "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement