There is a weighted undirected graph of
After these opertains, let the final state of the graph be
Find
Subtasks # | Score | Constraits |
---|---|---|
1 | 4 | |
2 | 8 | |
3 | 6 | |
4 | 18 | |
5 | 12 | All |
6 | 12 | |
7 | 12 | |
8 | 10 | All |
9 | 18 | - |
The first line contains three non-negative integers
The next
The next
Output one non-negative integer, the answer modulo 998244353.
Sample Input 1 | Sample Output 1 |
13 2 3
|
177
|
Sample Input 2 | Sample Output 2 |
80 5 10
|
512
|
Subtask | Score |
---|---|
1 | 4 |
2 | 8 |
3 | 6 |
4 | 18 |
5 | 12 |
6 | 12 |
7 | 12 |
8 | 10 |
9 | 18 |
10 | 0 |