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

20590번 - Biggest Set Ever 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB143333.333%

문제

A set of nonnegative integers is fine if and only if all numbers in the set are less than $T$ and their sum is equivalent to $\mathit{rem}$ modulo $n$. Your task is to find the number of different fine sets.

입력

The first line of the input contains space-separated integers $n$ and $\mathit{rem}$ (0ドル \le \mathit{rem} < n \le 10^4$). The second line of the input contains a single integer $T$ (1ドル \le T \le 10^{100,000円} - 1$).

출력

Print the number of different fine sets. As this number can be really large, you should print it modulo prime number 998ドル,244円,353円$.

제한

예제 입력 1

3 2
5

예제 출력 1

8

예제 입력 2

1 0
20

예제 출력 2

1048576

힌트

In the first sample, we can include or exclude numbers 0ドル$ and 3ドル$ freely, it doesn't change the remainder. From numbers $\{ 1, 2, 4 \}$ there are two fine sets: $\{ 2 \}$ and $\{ 1, 4 \}$. So the answer is 2ドル \cdot 2 \cdot 2 = 8$.

In the second sample, any subset of $\{ 0, 1, \ldots, 19 \}$ is fine, hence, the answer is 2ドル^{20} = 1,048円,576円$.

출처

Camp > Petrozavodsk Programming Camp > Summer 2020 > Day 2: SPb SU LOUD ENOUGH Contest B번

Contest > Open Cup > 2020/2021 Season > Stage 2: SPb SU LOUD ENOUGH Contest B번

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

출처

대학교 대회

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

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