题意:
思路:
#include <cstdio>
using namespace std;
typedef long long ll;
const ll mod = 998244353;
const int N = 2e6+1;
ll fac[N + 10],facInv[N + 10];
ll qpow(ll a,ll b){
ll res = 1;
while(b){
if(b&1) res = res*a%mod;
a = a*a%mod;
b >>= 1;
}
return res%mod;
}
ll inv(ll x){
return qpow(x,mod-2);
}
inline ll ksc(ll x,ll y,ll p){//计算x乘y的积
ll res=0;//加法初始化
while(y){
if(y&1)res=(res+x)%p;//模仿二进制
x=(x<<1)%p; y>>=1;//将x不断乘2达到二进制
}return res;
}
void init(){
fac[0] = 1ll;
for(int i = 1;i <= N;i++) fac[i] = fac[i-1]*i%mod;
facInv[N] = inv(fac[N]);
for(int i = N - 1;i >= 0;i--) facInv[i] = facInv[i+1]*(i+1)%mod;
}
ll C(ll n,ll m){
return fac[n] * inv(fac[m]) % mod * inv(fac[n - m]) % mod;
}
int main(){
ll n;
init();
while(~scanf("%lld",&n)){
ll res = ksc(fac[n],fac[n],mod);
res = res * inv(fac[2*n + 1]) % mod;
printf("%lld\n",res);
}
return 0;
}