atcoder#ARC137F. [ARC137F] Overlaps

[ARC137F] Overlaps

Score : 11001100 points

Problem Statement

We have a bar of length 11. A point on the bar whose distance from the left end of the bar is xx is said to have a coordinate xx.

Snuke will do the operation below NN times.

  • Choose two real numbers xx and yy uniformly at random from [0,1][0, 1]. Put a sticker covering the range from the coordinate min(x,y)\min(x,y) to the coordinate max(x,y)\max(x,y).

Here, all random choices are independent of each other.

Stickers can overlap. The bar is said to be good when no point is covered by K+1K+1 or more stickers.

Find the probability, modulo 998244353998244353, of having a good bar after putting NN stickers.

Definition of a probability modulo $998244353$

It can be proved that the sought probability is always a rational number. Additionally, under the Constraints of this problem, when that value is represented as an irreducible fraction PQ\frac{P}{Q}, it can be proved that Q≢0(mod998244353)Q \not \equiv 0 \pmod{998244353}. Thus, there is a unique integer RR such that $R \times Q \equiv P \pmod{998244353}, 0 \leq R < 998244353$. Report this RR.

Constraints

  • 1N2×1051 \leq N \leq 2 \times 10^5
  • 1Kmin(N,105)1 \leq K \leq \min(N,10^5)
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK

Output

Print the answer.

2 1
332748118

We are to find the probability that the two stickers do not overlap, which is 1/31/3.

5 3
66549624
10000 5000
642557092