小F对杨辉三角颇有研究,他把杨辉三角第nnn行的数提出来,从左到右分别为a[0],a[1],...,a[n−1]a[0],a[1],...,a[n-1]a[0],a[1],...,a[n−1]。
现在他想知道∑i=0n−1i2×a[i]\sum_{i=0}^{n-1}{i^{2}\times a[i]}∑i=0n−1i2×a[i]的值是多少,答案对998243539982435399824353取模。
输入一个正整数nnn,n≤1018n\leq 10^{18}n≤1018。
输出题目中式子的值,答案对99824353取模。
示例1
输入
3
输出
6
酱紫推?
/*keep on going and never give up*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define pb push_back
#define dbg1(x) cerr<<(#x)<<" "<<(x)<<" ";
#define dbg2(x) cerr<<(#x)<<" "<<(x)<<" "<<endl;
#define fast std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
inline int read(){int tep;scanf("%lld",&tep);return tep;}
const int maxn=2e3+10;
const int mod=99824353;
int n,m,f[maxn],vis[maxn][maxn];
char mp[maxn][maxn];
int ksm(int x,int y){
int tep=x,ans=1;
while(y){
if(y&1)
ans=ans*tep%mod;
tep=tep*tep%mod;
y>>=1;
}
return ans;
}
signed main() {
cin>>n;
if(n==1||n==0){
printf("0");
return 0;
}
else if(n==2){
printf("1");
return 0;
}
int ans;
ans=((n%mod)*((n-1)%mod))%mod*ksm(2,n-3)%mod;
printf("%lld",ans);
return 0;
}