Under construction

Still being built. Things may change

Mercurialist

Time limit2sMemory limit1024 MB

Summary
Alice drinks from X elixir, Y mercury, and Z yogurt bottles in random order; find her survival probability as a fraction modulo 998244353.
Level

Medium7 of 10

Topics
Probability, Combinatorics, Math
Solved
No attempts yet

Problem

This country has a medicine for immortality. Alice got X+Y+ZX + Y + Z bottles from the Hatter.

XX bottles contain elixir. If Alice drinks it, she will immediately become immortal.

YY bottles contain mercury, and each has a different toxicity. If she drinks the ii-th bottle, the following event ii will occur after K+i−0.5K + i - 0.5 days.

  • Event ii: Alice will immediately die if she has not drunk the elixir before event ii. If she has drunk the elixir, she won't die.

The remaining ZZ bottles contain yogurt. Nothing will happen when Alice drinks it.

At the same time every morning, Alice chooses one non-empty bottle with equal probability and drinks it. If all bottles are empty, she does nothing.

Answer the probability that Alice will be alive 10101010^{10^{10}} days after the first day she starts drinking bottles. Alice won't die other than events.

The probability can be expressed as PQ\frac{P}{Q} using coprime integers PP and QQ. Output a non-negative integer RR less than 998244353998244353 such that R×Q≡P(mod998244353)R \times Q \equiv P \pmod {998244353}. The probability is a rational number, and RR is uniquely determined under the conditions of this problem.

Input

XX YY ZZ KK

Output

Output RR defined in the statement. Add a new line at the end of the output.

Constraints

All inputs are integers.

1≤X,Y,Z,K≤1051 \le X, Y, Z, K \le 10^5

Hint

In Sample Input 1, Alice dies only if she drinks mercury on day 1 and yogurt on day 2. The probability of death is 1/3×1/2=1/61/3 \times 1/2 = 1/6, so the answer is 5/65/6.

In Sample Input 2, Alice never dies.

Examples4

  1. Example 1

    Input
    1 1 1 1
    
    Expected output
    831870295
    
  2. Example 2

    Input
    1 1 1 100
    
    Expected output
    1
    
  3. Example 3

    Input
    2 2 1 2
    
    Expected output
    565671801
    
  4. Example 4

    Input
    12912 83717 73177 1920
    
    Expected output
    685360162