Pagini recente » Cod sursa (job #126650) | Cod sursa (job #133722) | Cod sursa (job #383576) | Cod sursa (job #2905064) | Cod sursa (job #1181729)
#include <cstdio>
#define MOD 9999991
#define Nmax 1000000
using namespace std;
int fact[2*Nmax+5];
inline void PreCalcul()
{
int i;
fact[0]=1;
for(i=1;i<=2000000;++i)
fact[i]=(1LL*fact[i-1]*i)%MOD;
}
inline int Pow_Log(int x, int p)
{
int put=1;
while(p)
{
if(p&1)
{
put=(1LL*put*x)%MOD;
--p;
}
p>>=1;
x=(1LL*x*x)%MOD;
}
return put;
}
int main()
{
int N,aux;
freopen ("dirichlet.in","r",stdin);
freopen ("dirichlet.out","w",stdout);
PreCalcul();
scanf("%d", &N);
aux=(1LL*(1LL*Pow_Log(fact[N],MOD-2)*Pow_Log(fact[N],MOD-2))%MOD*Pow_Log(N+1,MOD-2))%MOD;
printf("%d\n", (1LL*fact[2*N]*aux)%MOD);
return 0;
}