Problem list
Log in
#coci00640 · COCI 2022/2023 Contest 4

Bojanje

Platinum II 1.0 s 512 MB

Oliver is a rubber duck that, not only finds bugs, but also likes to paint. His latest painting has $n$ parts, each coloured with a unique colour. After he got a lot of critiques his painting is too predictable, he decided to modify his painting in $t$ iterations. In every iteration he will do the following steps:

  1. Oliver will select uniformly at random an index $i$ ($1 \le i \le n$), and memorize the colour on the $i$-th part od the painting.
  2. Again, Oliver will select uniformly at random an index $j$ ($1 \le j \le n$). He will repaint the $j$-th part of the painting with the colour of the $i$-th part od the painting. If the $j$-th part is already painted in that colour, there is no change. Note that $i$ can be equal to $j$. Now, Oliver is afraid his painting will become monotonous or boring. He considers a painting good if there are at least $k$ differents colours on it. Help him calculate the probability that his painting will be good at the end.

Input

The first line contains the numbers from the task statement $n$, $t$ and $k$ ($2 \le k \le n \le 10$, $1 \le t \le 10^{18}$).

Output

In the first and only line output the answer modulo $10^{9} + 7$. Formally, let $m = 10^{9} + 7$. It can be shown that the answer can be expressed as an irreducible fraction ^{p} $q$ ^{,} where $p$ and $q$ are integers and $q$̸ ≡0 (mod $m$). Output the integer equal to $p \cdot q$^{−}^{1} mod $m$. In other words, output such an integer $x$ that $0 \le x < m$ and $x \cdot q$ ≡$p$ (mod $m$).

Example 1

Input
2 1 2
Output
500000004

Example 2

Input
10 2 5
Output
1

Example 3

Input
3 141592653589793 2
Output
468261332

Clarification of the first example: On the painting there are two colours, so the probability that it remains the same after one iteration is 1 2. Clarification of the second example: After two iterations, the number of different colours can’t go from 10 to less than 5, so in every case the painting will have at least 5 different colours.

Source
COCI 2022/2023 Contest 4
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code