You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
int main() {
|
|
long int i,n;
|
|
scanf("%ld",&n);
|
|
long int a[n+1];
|
|
a[1]=1;
|
|
a[2]=1;
|
|
if(n>2) {
|
|
for(i=3; i<=n; i++)
|
|
a[i]=a[i-1]%10007+a[i-2]%10007;
|
|
}
|
|
long int t=a[n]%10007;
|
|
printf("%ld",t);
|
|
return 0;
|
|
}
|
|
|
|
|