問題一覧 > 通常問題

No.2468 Mercurialist

レベル : / AI推定難易度 : 2100 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 12
作問者 : SPD_9X2 / テスター : akakimidori りあん tsutaj beet 👑 tute7627 nok0 👑 rin204 だれ momoyuu KKT89
お気に入りにしたユーザー ProblemId : 9607 / 自分の提出
問題文最終更新日: 2023-09-17 19:25:53
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
Japan Alumni Group Summer Camp 2023 Day 2 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。