AtCoder Regular Contest 137
F
Overlaps
AtCoder
⌀ 3313
原题
← E→
翻译中…

Problem Statement

翻译中…

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

翻译中…

Snuke will do the operation below $N$ times.

翻译中…
  • Choose two real numbers $x$ and $y$ uniformly at random from $[0, 1]$. Put a sticker covering the range from the coordinate $\min(x,y)$ to the coordinate $\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+1$ or more stickers.

翻译中…

Find the probability, modulo $998244353$, of having a good bar after putting $N$ 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 $\frac{P}{Q}$, it can be proved that $Q \not \equiv 0 \pmod{998244353}$. Thus, there is a unique integer $R$ such that $R \times Q \equiv P \pmod{998244353}, 0 \leq R < 998244353$. Report this $R$.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 2 \times 10^5$
  • $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:

翻译中…

N K

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
2 1
Output #1
332748118
We are to find the probability that the two stickers do not overlap, which is $1/3$.
Input #2
5 3
Output #2
66549624
Input #3
10000 5000
Output #3
642557092
题目信息
题号
arc137_f
时间限制
6 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。