Codeforces Round 439 (Div. 2)
C
The Intriguing Obsession
Codeforces
1800
原题
← BD →
翻译中…

— This is not playing but duty as allies of justice, Nii-chan!

翻译中…

— Not allies but justice itself, Onii-chan!

翻译中…

With hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire Sisters — Karen and Tsukihi — is heading for somewhere they've never reached — water-surrounded islands!

翻译中…

There are three clusters of islands, conveniently coloured red, blue and purple. The clusters consist of $*a*$, $*b*$ and $*c*$ distinct islands respectively.

翻译中…

Bridges have been built between some (possibly all or none) of the islands. A bridge bidirectionally connects two different islands and has length $1$. For any two islands of the same colour, either they shouldn't be reached from each other through bridges, or the shortest distance between them is at least $3$, apparently in order to prevent oddities from spreading quickly inside a cluster.

翻译中…

The Fire Sisters are ready for the unknown, but they'd also like to test your courage. And you're here to figure out the number of different ways to build all bridges under the constraints, and give the answer modulo $998 244 353$. Two ways are considered different if a pair of islands exist, such that there's a bridge between them in one of them, but not in the other.

翻译中…

Input

翻译中…

The first and only line of input contains three space-separated integers $*a*$, $*b*$ and $*c*$ ($1 ≤ *a*, *b*, *c* ≤ 5 000$) — the number of islands in the red, blue and purple clusters, respectively.

翻译中…

Output

翻译中…

Output one line containing an integer — the number of different ways to build bridges, modulo $998 244 353$.

翻译中…

Note

翻译中…

In the first example, there are $3$ bridges that can possibly be built, and no setup of bridges violates the restrictions. Thus the answer is $2^{3} = 8$.

翻译中…

In the second example, the upper two structures in the figure below are instances of valid ones, while the lower two are invalid due to the blue and purple clusters, respectively.

翻译中…

image

翻译中…

样例

Input #1
1 1 1
Output #1
8
InputCopy OutputCopy
Input #2
1 2 2
Output #2
63
InputCopy OutputCopy
Input #3
1 3 5
Output #3
3264
InputCopy OutputCopy
Input #4
6 2 9
Output #4
813023575
InputCopy OutputCopy
题目信息
题号
869C
时间限制
1 s
内存限制
256 MB
标签
组合数学
动态规划
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。