QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 64 MB مجموع النقاط: 100

#23783. ビンゴ

الإحصائيات

問題文

あるプログラミングコンテストでは,懇親会でビンゴゲームをする習わしがある.ただし,このビンゴゲームで使うビンゴカードは少々特殊であり,以下の条件に従って作成される.

  • ビンゴカードは $N$ 行 $N$ 列のマス目に区切られており,各マス目には正整数が $1$ つずつ書かれている.それらの整数はすべて異なる.
  • マス目に書かれている整数は $1$ 以上 $M$ 以下である.
  • ビンゴカードに書かれている $N \times N$ 個の整数の合計は $S$ である.
  • どの列を見ても,上から下に向かって整数が昇順に並んでいる.
  • どのマス目の整数も,そのマスより左の列のどの整数よりも大きい.

以下は,$N = 5$,$M = 50$,$S = 685$ のときのビンゴカードの例である.

problem_23783_3b2a0d21c8a4b9c6e11f8039ae7ce9bd.png

懇親会のために,上の条件を満たすビンゴカードをできるだけたくさん作りたい.ただし,同一のカードを $2$ 枚以上作ってはいけない.作ることができるビンゴカードの最大枚数を $100000$ で割った余りを出力するプログラムを作成せよ.

入力

入力は $1$ 行からなり,その行にはビンゴカードのサイズ $N$($1 \le N \le 7$),マス目に書かれている整数の上限 $M$($1 \le M \le 2000$),ビンゴカードに書かれている整数の合計 $S$($1 \le S \le 3000$)を表す $3$ つの正整数が空白区切りで書かれている.ただし,与えられるどの入力データにおいても,条件を満たすビンゴカードを $1$ 枚以上作ることができる.

出力

作ることができるビンゴカードの最大枚数を $100000$ で割った余りを $1$ 行で出力せよ.

入出力例 1

入力

3 9 45

出力

1

入出力例 2

入力

3 100 50

出力

7

入出力例 3

入力

5 50 685

出力

74501

補足

入出力例 $3$ に対して,作ることができるビンゴカードの最大枚数は $642499974501$ 枚であるので,$100000$ で割った余りである $74501$ を出力する.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.