問題一覧 > 通常問題

No.2001 Distanced Triple

レベル : / AI推定難易度 : 1500 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 50
作問者 : 👑 to-omer / テスター : 👑 Kazun ygussany
お気に入りにしたユーザー ProblemId : 7714 / 自分の提出
問題文最終更新日: 2022-07-05 22:13:55
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 351 (順位表) の他の問題:

Problem Statement

Find the number, modulo $998244353$, of triples $(x,y,z)$ of positive integers between $L$ and $R$, inclusive, that satisfy all of the following conditions.

  • $x+A\le y$
  • $y+B\le z$
  • $x+C\le z$

Constraints

  • All input values are integers.
  • $1\le L\le R\le 10^{18}$
  • $0\le A,B,C\le 10^{18}$

Input

$L$ $R$
$A$ $B$ $C$

Output

Print the answer in 1 line.

Sample

Sample 1
Input
1 4
1 1 1
Output
4

The following $4$ triples $(x,y,z)$ satisfy the conditions.

  • $(1,2,3)$
  • $(1,2,4)$
  • $(1,3,4)$
  • $(2,3,4)$
Sample 2
Input
3 7
0 1 2
Output
16
Sample 3
Input
1 1000000000000000000
314 159 265
Output
547930521

Find the answer modulo $998244353$.

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