AtCoder Beginner Contest 113
D
Number of Amidakuji
AtCoder
⌀ 1597
原题
← C→
翻译中…

Problem Statement

翻译中…

Amidakuji is a traditional method of lottery in Japan.

翻译中…

To make an amidakuji, we first draw $W$ parallel vertical lines, and then draw horizontal lines that connect them. The length of each vertical line is $H+1$ [cm], and the endpoints of the horizontal lines must be at $1, 2, 3, ...,$ or $H$ [cm] from the top of a vertical line.

翻译中…

A valid amidakuji is an amidakuji that satisfies the following conditions:

翻译中…
  • No two horizontal lines share an endpoint.
  • The two endpoints of each horizontal lines must be at the same height.
  • A horizontal line must connect adjacent vertical lines.
翻译中…

image

翻译中…

Find the number of the valid amidakuji that satisfy the following condition, modulo $1\ 000\ 000\ 007$: if we trace the path from the top of the leftmost vertical line to the bottom, always following horizontal lines when we encounter them, we reach the bottom of the $K$-th vertical line from the left.

翻译中…

For example, in the following amidakuji, we will reach the bottom of the fourth vertical line from the left.

翻译中…

image

翻译中…

Constraints

翻译中…
  • $H$ is an integer between $1$ and $100$ (inclusive).
  • $W$ is an integer between $1$ and $8$ (inclusive).
  • $K$ is an integer between $1$ and $W$ (inclusive).
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

H W K

翻译中…

Output

翻译中…

Print the number of the amidakuji that satisfy the condition, modulo $1\ 000\ 000\ 007$.

翻译中…

样例

Input #1
1 3 2
Output #1
1
Only the following one amidakuji satisfies the condition: ![image](https://img.atcoder.jp/ghi/c68c6daccfc4cba8bc94af5f1a80ef2f.png)
Input #2
1 3 1
Output #2
2
Only the following two amidakuji satisfy the condition: ![image](https://img.atcoder.jp/ghi/4be150946de8bef9b14d9bc17814d963.png)
Input #3
2 3 3
Output #3
1
Only the following one amidakuji satisfies the condition: ![image](https://img.atcoder.jp/ghi/9b2e9f49832458c3488b1e04afd51ed4.png)
Input #4
2 3 1
Output #4
5
Only the following five amidakuji satisfy the condition: ![image](https://img.atcoder.jp/ghi/bf6ec766f8923ac2f082f538a6c736b6.png)
Input #5
7 1 1
Output #5
1
As there is only one vertical line, we cannot draw any horizontal lines. Thus, there is only one amidakuji that satisfies the condition: the amidakuji with no horizontal lines.
Input #6
15 8 5
Output #6
437760187
Be sure to print the answer modulo $1\ 000\ 000\ 007$.
题目信息
题号
abc113_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。