088 - Simple Math Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 300300

問題文

33 つの正整数 A,B,CA, B, C が与えられます。

a=1Ab=1Bc=1Cabc\sum_{a=1}^{A} \sum_{b=1}^{B} \sum_{c=1}^{C} abc

998244353998244353 で割った余りを求めてください。

制約

  • 1A,B,C1091 \leq A, B, C \leq 10^9

入力

入力は以下の形式で標準入力から与えられる。

AA BB CC

出力

求めた値を 998244353998244353 で割った余りを出力せよ。


入力例 1Copy

Copy
1 2 3

出力例 1Copy

Copy
18

(1×1×1)+(1×1×2)+(1×1×3)+(1×2×1)+(1×2×2)+(1×2×3)=1+2+3+2+4+6=18(1 \times 1 \times 1) + (1 \times 1 \times 2) + (1 \times 1 \times 3) + (1 \times 2 \times 1) + (1 \times 2 \times 2) + (1 \times 2 \times 3) = 1 + 2 + 3 + 2 + 4 + 6 = 18 となります。


入力例 2Copy

Copy
1000000000 987654321 123456789

出力例 2Copy

Copy
951633476

998244353998244353 で割った余りを求めることに注意してください。

Score : 300300 points

Problem Statement

Given are three positive integers AA, BB, and CC. Compute the following value modulo 998244353998244353:

a=1Ab=1Bc=1Cabc\sum_{a=1}^{A} \sum_{b=1}^{B} \sum_{c=1}^{C} abc

Constraints

  • 1A,B,C1091 \leq A, B, C \leq 10^9

Input

Input is given from standard input in the following format:

AA BB CC

Output

Print the value modulo 998244353998244353.


Sample Input 1Copy

Copy
1 2 3

Sample Output 1Copy

Copy
18

We have: (1×1×1)+(1×1×2)+(1×1×3)+(1×2×1)+(1×2×2)+(1×2×3)=1+2+3+2+4+6=18(1 \times 1 \times 1) + (1 \times 1 \times 2) + (1 \times 1 \times 3) + (1 \times 2 \times 1) + (1 \times 2 \times 2) + (1 \times 2 \times 3) = 1 + 2 + 3 + 2 + 4 + 6 = 18.


Sample Input 2Copy

Copy
1000000000 987654321 123456789

Sample Output 2Copy

Copy
951633476

Be sure to compute the value modulo 998244353998244353.



2025-04-07 (Mon)
13:05:11 +00:00