atcoder#ARC137F. [ARC137F] Overlaps
[ARC137F] Overlaps
Score : points
Problem Statement
We have a bar of length . A point on the bar whose distance from the left end of the bar is is said to have a coordinate .
Snuke will do the operation below times.
- Choose two real numbers and uniformly at random from . Put a sticker covering the range from the coordinate to the coordinate .
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 or more stickers.
Find the probability, modulo , of having a good bar after putting 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 , it can be proved that . Thus, there is a unique integer such that $R \times Q \equiv P \pmod{998244353}, 0 \leq R < 998244353$. Report this .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
2 1
332748118
We are to find the probability that the two stickers do not overlap, which is .
5 3
66549624
10000 5000
642557092