No.2468 Mercurialist
Problem Statement
In this country, a medicine that grants immortality is in circulation. Alice received $X+Y+Z$ bottles of medicine from The Hatter.
Of these, $X$ bottles contain elixir; drinking it immediately makes one immortal.
$Y$ bottles contain mercury. Each differs in toxicity: if Alice drinks the liquid in the $i\ (1 \le i \le Y)$-th bottle containing mercury, the following event $i$ occurs $K+i-0.5$ days later.
- Event $i$: If Alice has never drunk elixir by the time event $i$ occurs, she dies immediately. If she has drunk it, she does not die.
The remaining $Z$ bottles contain yogurt. Drinking it has no effect.
Every morning at the same time, Alice chooses one of the non-empty bottles uniformly at random and drinks all of its contents. If all bottles are empty, she does nothing.
Find the probability that Alice is alive $10^{10^{10}}$ days after the morning she first drank the contents of a bottle. Alice does not die from any cause other than the events.
It can be proved that the desired probability is a rational number. Therefore, it can be expressed as $\frac{P}{Q}$ using coprime integers $P,Q$. Output the integer $R$ that satisfies $R \times Q \equiv P \pmod {998244353}$ and is at least $0$ and less than $998244353$. (It can be proved that $R$ is uniquely determined under the conditions of this problem.)
Input
$X\ Y\ Z\ K$
- All inputs are integers.
- $1 \le X,Y,Z,K \le 10^5$
Output
Print a newline at the end.
Sample
Sample 1
Input
1 1 1 1
Output
831870295
Alice dies only if she drinks mercury on day 1 and yogurt on day 2. The probability of death is $1/3 \times 1/2 = 1/6$, so the answer is $5/6$.
Sample 2
Input
1 1 1 100
Output
1
She always survives.
Sample 3
Input
2 2 1 2
Output
565671801
Sample 4
Input
12912 83717 73177 1920
Output
685360162
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
SPD_9X2
akakimidori
りあん
tsutaj
beet
tute7627
nok0
だれ
momoyuu