传送门
E-The Intriguing Obsession
code:
#include<bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
const int maxn = 2e5 + 9;
const int mod = 998244353;
ll n, m, t;
ll fac[maxn];
ll q_pow(ll a, ll n, ll ans = 1){
while(n){
if(n & 1) ans=ans*a%mod;a=a*a%mod;n>>=1;
}return ans;
}
ll C(ll n, ll m)
{
ll x = 1, y = 1;
for(ll i = 1; i <= m; ++i)
x = x * i % mod, y = y * (n - i + 1) % mod;
return y * q_pow(x, mod - 2) % mod;
}
ll solve(ll a, ll b)
{
ll ans = 0;
for(int i = 0; i <= min(a, b); ++i)
ans = (ans + C(a, i) * C(b, i) % mod * fac[i] % mod) % mod;
return ans;
}
void work()
{
fac[0] = 1;
for(int i = 1; i <= maxn - 9; ++i)
fac[i] = fac[i-1] * i % mod;
cin >> n >> m >> t;
cout << solve(n, m) * solve(m, t) % mod * solve(n, t) % mod;
}
int main()
{
ios::sync_with_stdio(0);
// int TT;cin>>TT;while(TT--)
work();
return 0;
}