Pagini recente » Cod sursa (job #2116646) | Cod sursa (job #444505) | Cod sursa (job #765932) | Cod sursa (job #2422784) | Cod sursa (job #1362017)
#include <fstream>
using namespace std;
ifstream in("dirichlet.in");
ofstream out("dirichlet.out");
long long n,n2;
long long a = 1,b = 1,i;
long long pow(long long x, long long y)
{
if (y == 1)
return x;
if (y % 2 == 0)
return pow(x, y/2) * pow(x, y/2) % 9999991;
else
return (x * pow(x, y/2) % 9999991) * pow(x, y/2) % 9999991;
}
int main()
{
in >> n;
n2 = 2 * n;
for (i=2; i<=n; i++)
a = (a * i) % 9999991;
for (i=n+2; i<=n2; i++)
b = b * i % 9999991;
out << (b * pow(a, 9999991 - 2) % 9999991) % 9999991 << '\n';
return 0;
}