luogu#P8114. [Cnoi2021] 六边形战士

    ID: 7200 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2021LGV 引理O2优化组合数学线性代数行列式

[Cnoi2021] 六边形战士

Background

With Cirno’s careful care, the hexagon has grown into a cute parallelogram-like hexagon.

Now, Cirno really wants to know how strong its fighting power is.

Problem Description

In this cute parallelogram-like hexagon, the angle between every pair of adjacent sides is 2π3\frac{2\pi}{3}. The lengths of the three pairs of opposite sides are aa, bb, and cc units, respectively, as shown in the figure.

During the fighting power evaluation, the evaluator builds, for each line containing a side of the hexagon, a family of parallel lines spaced 32\frac{\sqrt{3}}{2} units apart. In this way, the hexagon warrior is divided into several equilateral triangles, as shown in the figure.

The evaluator then connects all equilateral triangles that share a common edge. Since there is no odd cycle, it is easy to see that this is a bipartite graph. Then the evaluator tries to construct a perfect matching of this bipartite graph, as shown in the figure.

The fighting power of this hexagon warrior is the number of possible perfect matchings of the above bipartite graph. As a trainee evaluator, you need to help Cirno compute the fighting power of this hexagon.

Since the answer may be too large, you only need to output it modulo 998244353998244353.

Input Format

One line with three integers separated by spaces, representing aa, bb, and cc.

Output Format

One line with one integer, representing the fighting power of the hexagon warrior modulo 998244353998244353.

1 1 1
2
3 4 3
4116

Hint

Constraints and Notes

For 100%100\% of the data, it is guaranteed that 1a,b,c1061 \le a, b, c \le 10^6.

Subtasks

Subtask 1 (1010 points): a,b,c3a, b, c \le 3.

Subtask 2 (1010 points): a,b,c8a, b, c \le 8.

Subtask 3 (7070 points): a,b,c100a, b, c \le 100.

Subtask 4 (1010 points): No special constraints.

Hint

  • Krattenthaler’s formula
    $\displaystyle\det\left(\prod\limits_{k=2}^j(x_i+a_k)\prod\limits_{k=j+1}^n(x_i+b_k)\right)_{i,j=1}^{n}=\prod\limits_{1\le i<j\le n}{(x_i-x_j)}\prod\limits_{2<i\le j\le n}(a_i-b_j)$。

Translated by ChatGPT 5