传统题 3000ms 256MiB

Stay On The Spot

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

说明

There is an array of length $n$, with a pointer at index $1$ at the beginning.

In each operation, you can move the pointer one step to the left or right, or stop in place (the pointer cannot be moved outside the array range).

You are given two integer $n,k$, please calculate the number of performances that after exactly $k$ operations are performed, the pointer still points to $1$.

Since the answer may be very large, please print the answer modulo $10^9 + 7$.

输入格式

The only line contains two integers $n,k$ $(2 \leq k < n \leq 10^4)$.

输出格式

Print the answer modulo $10^9+7$.

样例

2 4
8

样例

2 3
4

提示

In the second sample, you can move like these four methods : 1$\rightarrow$1$\rightarrow$1$\rightarrow$1, 1$\rightarrow$1$\rightarrow$2$\rightarrow$1,  1$\rightarrow$2$\rightarrow$1$\rightarrow$1, 1$\rightarrow$2$\rightarrow$2$\rightarrow$1.

福建师范大学第十八届程序设计竞赛正式赛

未参加
状态
已结束
规则
IOI
题目
10
开始于
2022-4-25 8:00
结束于
2023-3-24 16:00
持续时间
8000 小时
主持人
参赛人数
15