#pragma GCC optimize("Ofast") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pii; typedef pair pil; typedef pair pli; typedef pair pll; templateconstexpr bool chmin(T&a,const U b){if(a<=b)return false;a=b;return true;} templateconstexpr bool chmax(T&a,const U b){if(a>=b)return false;a=b;return true;} #define bit(n,k) ( (n>>k)&1 ) //デバッグ template void Vout(vector &V){ cout<<"\nstart\n"; const int sz=V.size(); for(int i=0;i void VPout(vector &V){ cout<<"\nstart\n"; const int sz=V.size(); for(int i=0;i> data(3, vector(4)); //vector.resize(a,vector(b,-1)); //vector>> 変数名(要素数1, vector>(要素数2, vector<要素の型>(要素数3, 初期値))); struct ModInt{ using u64=uint_fast64_t; u64 a; constexpr ModInt() :a(0){} constexpr ModInt(ll x) :a((x>=0)?(x%MOD):(x%MOD+MOD) ) {} inline constexpr ModInt operator+(const ModInt rhs)const noexcept{ return ModInt(*this)+=rhs; } inline constexpr ModInt operator-(const ModInt rhs)const noexcept{ return ModInt(*this)-=rhs; } inline constexpr ModInt operator*(const ModInt rhs)const noexcept{ return ModInt(*this)*=rhs; } inline constexpr ModInt operator/(const ModInt rhs)const noexcept{ return ModInt(*this)/=rhs; } inline constexpr ModInt operator+(const ll rhs) const noexcept{ return ModInt(*this)+=rhs; } inline constexpr ModInt operator-(const ll rhs)const noexcept{ return ModInt(*this)-=rhs; } inline constexpr ModInt operator*(const ll rhs)const noexcept{ return ModInt(*this)*=rhs; } inline constexpr ModInt operator/(const ll rhs)const noexcept{ return ModInt(*this)/=rhs; } inline constexpr ModInt &operator+=(const ModInt rhs)noexcept{ a+=rhs.a; if(a>=MOD) a-=MOD; return *this; } inline constexpr ModInt &operator-=(const ModInt rhs)noexcept{ if(rhs.a>a) a+=MOD; a-=rhs.a; return *this; } inline constexpr ModInt &operator*=(const ModInt rhs)noexcept{ a=(a*rhs.a)%MOD; return *this; } inline constexpr ModInt &operator/=(ModInt rhs)noexcept{ a=(a*rhs.inverse().a)%MOD; return *this; } inline constexpr ModInt &operator+=(const ll rhs)noexcept{ a+=rhs; if(a>=MOD) a-=MOD; return *this; } inline constexpr ModInt &operator-=(const ll rhs)noexcept{ if(rhs>a) a+=MOD; a-=rhs; return *this; } inline constexpr ModInt &operator*=(const ll rhs)noexcept{ a=(a*rhs)%MOD; return *this; } inline constexpr ModInt &operator/=(ll rhs)noexcept{ a=(a*ModInt(rhs).inverse().a)%MOD; return *this; } inline constexpr ModInt operator=(ll x)noexcept{ x%=MOD; if(x<0) x+=MOD; a=x; return *this; } inline constexpr bool operator==(const ModInt p)const noexcept{ return a==p.a; } inline constexpr bool operator!=(const ModInt p)const noexcept{ return a!=p.a; } inline constexpr ModInt pow(ll N) const noexcept{ ModInt ans(1LL),p(a); while(N>0){ if(bit(N,0)){ ans*=p; } p*=p; N>>=1; } return ans; } inline constexpr ModInt inverse() const noexcept{ return pow(MOD-2); } }; inline constexpr ModInt operator+(const ll &a,const ModInt &b)noexcept{ return ModInt(a)+=b; } inline constexpr ModInt operator-(const ll &a,const ModInt &b)noexcept{ return ModInt(a)-=b; } inline constexpr ModInt operator*(const ll &a,const ModInt &b)noexcept{ return ModInt(a)*=b; } inline constexpr ModInt operator/(const ll &a,const ModInt &b)noexcept{ return ModInt(a)/=b; } inline constexpr ModInt Mr(ll p){ p%=MOD; if(p<0) p+=MOD; return ModInt(p); } struct Binominal{ vector fac,finv,inv; //fac[n]:n! finv:(n!)の逆元 int sz; Binominal(int n=0) :sz(0){ init(n); } inline void init(int n){ fac.resize(n+1,1); finv.resize(n+1,1); inv.resize(n+1,1); for(int i=2;i<=n;i++){ fac[i]=fac[i-1]*i; inv[i]=MOD-inv[MOD%i]*(MOD/i); finv[i]=finv[i-1]*inv[i]; } } //nCk(n,k<=N) をO(1)で求める inline ModInt com(int n,int k){ if(nsz) init(n); return fac[n]*finv[k]*finv[n-k]; } //nCk(k<=N) をO(k) で求める inline ModInt rcom(ll n,int k){ if(n<0 || k<0 || nsz) init(k); ModInt ret(1); for(int i=0;i>a>>b>>c; int sum=a+b+c; ModInt ans(0),co(0); vector t(310000); t[0]=1; for(int i=1;i<310000;i++){ t[i]=t[i-1]*2; } for(int i=1;i<310000;i++){ t[i]+=t[i-1]; } Binominal B; for(int i=1;i<=a;i++){ int sum=a-i+b-1+c; co=B.com(sum,c)*B.com(sum-c,b-1); ans+=co*c/sum*t[sum-1]; } cout<