problem cf1800
计算两两之间的方法数,最终
a
n
s
=
c
a
l
(
a
,
b
)
∗
c
a
l
(
a
,
c
)
∗
c
a
l
(
b
,
c
)
m
o
d
p
ans = cal(a, b)*cal(a,c)*cal(b,c) mod\space p
ans=cal(a,b)∗cal(a,c)∗cal(b,c)mod p
两两之间的计算方法为依次枚举线的数量。
// Decline is inevitable,
// Romance will last forever.
#include <bits/stdc++.h>
using namespace std;
//#define mp make_pair
#define pii pair<int,int>
#define pb push_back
#define ll long long
#define LL long long
#define ld long double
#define endl '\n'
#define RE0 return 0
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define int long long
const int maxn = 5000 + 10;
const int P = 998244353; //998244353
const int INF = 0x7f7f7f7f;
int C[maxn+1][maxn+1]; //杨辉三角打表
void init() {
for(int i = 0; i <= maxn; i++) {
C[i][0] = C[i][i] = 1;
for(int j = 1; j < i; j++)
C[i][j] = (C[i-1][j] + C[i-1][j-1]) % P;
}
}
int fac[maxn];
int cal(int a, int b) {
int z = min(a, b);
int cnt = 0;
for(int i = 0; i <= z; i++) {
cnt = (cnt + C[a][i]*C[b][i]* fac[i]) % P;
}
return cnt;
}
int a, b, c;
void solve() {
cin >> a >> b >> c;
init();
fac[0] = 1;
for(int i = 1; i <= 5000; i++)
fac[i] = fac[i-1] * i % P;
int ans = cal(a, b) * cal(a, c) % P * cal(b, c) % P;
cout << ans << endl;
}
signed main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
// int T; scanf("%d", &T); while(T--)
// freopen("1channel00.txt","r",stdin);
// freopen("2.txt","w",stdout);
// int T; cin >> T; while(T--)
solve();
RE0;
}