Pagini recente » Cod sursa (job #2375779) | Cod sursa (job #2403031) | Cod sursa (job #658662) | Cod sursa (job #17195) | Cod sursa (job #3289115)
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
using namespace std;
//ifstream cin("/Users/alekuw/Desktop/informatica/informatica/Products/Debug/date.in");
//ofstream cout("/Users/alekuw/Desktop/informatica/informatica/Products/Debug/date.out");
ifstream cin("dirichlet.in");
ofstream cout("dirichlet.out");
int n;
const int MOD=9999991;
int fast_pow(int k, int p){
int rasp=1;
while (p>0){
if(p&1)
rasp=1LL*rasp*k%MOD;
k=1LL*k*k%MOD;
p/=2;
}
return rasp;
}
int main() {
cin>>n;
int f1=1,f2=n+1;
for(int i=1;i<=n;++i){
f1=1LL*f1*(n+i)%MOD;
f2=1LL*f2*i%MOD;
}
cout<<1LL*f1*fast_pow(f2,MOD-2)%MOD;
return 0;
}