問題一覧 > 通常問題

No.2683 Two Sheets

レベル : / AI推定難易度 : 1325 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 80
作問者 : arad / テスター : 👑 tute7627 SPD_9X2 👑 rin204 だれ kemuniku kyawa ma_tw kosuke-nori Haowen Li
お気に入りにしたユーザー ProblemId : 10422 / 自分の提出
問題文最終更新日: 2024-03-20 18:27:57
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
yukicoder contest 422 (第1回 競技プログラミング講習会作問企画コンテスト) (順位表) の他の問題:

Problem Statement

There is a grid with $H$ rows and $W$ columns. The cell in the $i$-th row from the top and the $j$-th column from the left is called $(i,j)$. Initially, no cell is painted black. Takahashi will now repeat the following operation $2$ times.

  • Choose an integer $x$ between $1$ and $H-A+1$, inclusive, and an integer $y$ between $1$ and $W-B+1$, inclusive, independently and uniformly at random, and paint black the rectangular region of $A$ rows and $B$ columns whose top-left cell is $(x,y)$.

Find the expected value, $\rm{mod}\ 998244353$, of the number of cells painted black after Takahashi finishes the $2$ operations.

Definition of a rational number $\rm{mod}\ 998244353$

It can be proved that, under the constraints of this problem, the expected value to be found is always a rational number. Moreover, when this expected value is expressed as an irreducible fraction using coprime positive integers $P$, $Q$ as $P/Q$, it can be shown that $Q$ is not divisible by $998244353$, and that an integer satisfying $P \equiv Q \times R \mod 998244353$, at least $0$ and less than $998244353$, is uniquely determined as $R$. Find this $R$.

Input

$H\ W\ A\ B$

  • All input values are integers.
  • $1\leq A\leq H \leq 2 \times 10^5$
  • $1\leq B\leq W \leq 2 \times 10^5$

Output

Print the answer as an integer on one line, followed by a newline.

Sample

Sample 1
Input
2 3 1 2
Output
748683268

For example, if $x=1, y=1$ is chosen in the 1st operation and $x=1, y=2$ is chosen in the 2nd operation, the cells painted black are the 3 cells $(1,1), (1,2), (1,3)$.

It can be shown that the expected number of cells painted black is $13/4$.

Sample 2
Input
1 1 1 1
Output
1

Sample 3
Input
13223 2930 50 222
Output
371659179

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。