No.2685 Cell Proliferation (Easy)
問題文最終更新日: 2024-03-21 00:41:44
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Problem Statement
This problem differs from Cell Proliferation (Hard) only in the constraints and the execution time limit.
- When $t$ seconds have passed since its birth, it immediately gives birth to $1$ new AIC cell with probability $\displaystyle\frac{P_1}{P_2}$.
- When $(t + 0.5)$ seconds have passed since its birth, it immediately dies and disappears with probability $\displaystyle1 - \left(\frac{Q_1}{Q_2}\right)^t$.
Now, exactly $1$ AIC cell has just been born. Find the expected value, $\mathrm{mod} \ 998244353$, of the number of AIC cells at the time $(T + 0.9)$ seconds after the current time.
Definition of the expected value $\mathrm{mod} \ 998244353$
It can be proved that the expected value to be found is always a rational number. Also, under the constraints of this problem, it is guaranteed that when the expected value is expressed as an irreducible fraction $\displaystyle\frac{P}{Q}$, $Q$ is not divisible by $998244353$.
In this case, there exists a unique integer $R$ such that $0 \le R < 998244353$ and $P \equiv QR \pmod{998244353}$. Output this $R$.
Input
$P_1 \ P_2 \ Q_1 \ Q_2 \ T$
- $0 \le P_1 \le P_2 < 998244353, \ P_2 \ne 0$
- $0 \le Q_1 \le Q_2 < 998244353, \ Q_2 \ne 0$
- $1 \le T \le 10^3$
- All input values are integers.
Output
Output the answer as described in "Definition of the expected value $\mathrm{mod} \ 998244353$" above.
Sample
Sample 1
Input
1 2 3 4 2
Output
577110018
The expected value at $2.9$ seconds after the current time is $\displaystyle\frac{91}{64}$. Since $91 \equiv 64 \times 577110018 \pmod{998244353}$, output $577110018$.
Sample 2
Input
1 998244352 12345678 23456789 1000
Output
687546754
Sample 3
Input
0 1858 0 2024 166
Output
0
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
tute7627
SPD_9X2
だれ
Ayuna