Logo
(追記) (追記ここまで)

27423번 - Cake Decoration 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 1024 MB58282548.077%

문제

You are ordering a cake to celebrate the New Year. You have to decide the numbers of decoration items to be topped on the cake. Available items are dog figures, cat figures, red candies, and blue candies.

You want all four items to decorate the cake, and all the numbers of the four items to be different from each other. You also want the number of figures (the sum of dogs and cats) to be within a certain range.

An extra charge for the decoration items is added to the price of the cake. The extra is, although quite queer, the product of the numbers of the four decoration items. You want the cake to look gorgeous as far as the budget allows. Thus, you are not satisfied with a decoration if you can add any of the four items without violating the budget constraint.

The conditions stated above are summarized as follows. Let $d,ドル $c,ドル $r,ドル and $b$ be the numbers of dog figures, cat figures, red candies, and blue candies, respectively. All these numbers should be different positive integers satisfying the following conditions for given $X,ドル $L,ドル and $R$:

  • $L ≤ d + c < R,ドル
  • $d \times c \times r \times b ≤ X,ドル
  • $(d + 1) \times c \times r \times b > X,ドル
  • $d \times (c + 1) \times r \times b > X,ドル
  • $d \times c \times (r + 1) \times b > X,ドル and
  • $d \times c \times r \times (b + 1) > X$.

More than one combination of four numbers of decoration items may satisfy the conditions. Your task is to find how many such combinations exist.

입력

The input consists of a single test case of the following format.

$X$ $L$ $R$

Here, $X,ドル $L,ドル and $R$ are integers appearing in the conditions stated above. They satisfy 1ドル ≤ X ≤ 10^{14}$ and 1ドル ≤ L < R ≤ 10^{14}$.

출력

Output the number of combinations of four numbers of decoration items that satisfy the conditions stated above modulo a prime number 998ドル,244円,353円 = 2^{23} \times 7 \times 17 + 1$.

제한

예제 입력 1

24 4 6

예제 출력 1

12

예제 입력 2

30 5 6

예제 출력 2

4

예제 입력 3

30 9 20

예제 출력 3

0

예제 입력 4

100000000000000 1 100000000000000

예제 출력 4

288287412

힌트

For Sample Input 2, four combinations of $(d, c, r, b) = (2, 3, 1, 5), (2, 3, 5, 1), (3, 2, 1, 5),ドル and $(3, 2, 5, 1)$ satisfy all the conditions. $(d, c, r, b) = (1, 4, 2, 3)$ is not eligible because its extra cost for the decoration items does not exceed $X = 30$ even after adding one more cat figure. $(d, c, r, b) = (1, 5, 2, 3)$ is also ineligible because $d + c < R = 6$ does not hold.

출처

ICPC > Regionals > Asia Pacific > Japan > ICPC 2022 Asia Yokohama Regional H번

Camp > Petrozavodsk Programming Camp > Summer 2023 > Day 1: Starting Contest H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /