Universal Cup Judging System

Universal Cup

Süre Sınırı: 12 s Bellek Sınırı: 1024 MB Toplam puan: 100 Zorluk: [göster]
İstatistikler

Description

Kamome is making efforts to train the AI to play games. She is having the AI train the game "Senren Banka".

This game consists of $n$ choice branches in each round. You are considered to pass the game if and only if you select each branch correctly in one round. Each round starts with branch $1$, and for each $i = 1, 2, \dots, n - 1$, you can select the $(i + 1)$-th branch only after selecting the $i$-th branch correctly. If you make a wrong choice, you will enter the Bad Ending and have to start over from the beginning. This is regarded as a new round of the game.

Kamome's AI can learn from past choices. More specifically, if this is the $j$-th time choosing the $i$-th branch, then the AI has a probability of $p_{i,\min(m,j)}$ of choosing the correct option.

Kamome wants to know the expected number of rounds it would take for this AI to pass the game for the first time. Output the result modulo $998244353$.

Input

The first line contains two integers $n, m$ ($1 \le n \le 20$, $1 \le m \le 5 \times 10^4$), indicating the number of choice branches and the threshold of this AI.

The next $n$ lines each contain $m$ integers $p'_{i,j}$ ($1 \le p'_{i,j} \le 100$), indicating $p_{i,j} = \frac{p'_{i,j}}{100}$.

Output

Output one line containing one integer, indicating the answer modulo $998244353$.

Examples

input1

1 1
50

output1

2

input2

2 2
25 50
50 25

output2

499122183

input3

10 10
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100

output3

473598335

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.