AtCoder Grand Contest 058
D
Yet Another ABC String
AtCoder
⌀ 3159
原题
← CE →
翻译中…

Problem Statement

翻译中…

You are given integers $A$, $B$, and $C$. How many strings $S$ consisting of A, B, and C satisfy all of the following conditions? Find the count modulo $998244353$.

翻译中…
  • The number of occurrences of A, B, and C in $S$ are $A$, $B$, and $C$, respectively.
  • $S$ contains none of ABC, BCA, and CAB as a (contiguous) substring.
翻译中…

Constraints

翻译中…
  • $1 \leq A,B,C \leq 10^6$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

A B C

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
1 1 1
Output #1
3
The three strings that satisfy the conditions are `ACB`, `CBA`, and `BAC`.
Input #2
2 2 2
Output #2
42
Input #3
96 11 46
Output #3
818015722
Input #4
125132 102271 152064
Output #4
128086069
题目信息
题号
agc058_d
时间限制
2 s
内存限制
1024 MB

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