AtCoder Grand Contest 045
翻译中…
Problem Statement
翻译中…
Snuke has a string $x$ of length $N$. Initially, every character in $x$ is 0.
翻译中…
Snuke can do the following two operations any number of times in any order:
翻译中…
- Choose
$A$consecutive characters in$x$and replace each of them with0. - Choose
$B$consecutive characters in$x$and replace each of them with1.
翻译中…
Find the number of different strings that $x$ can be after Snuke finishes doing operations. This count can be enormous, so compute it modulo $(10^9+7)$.
翻译中…
Constraints
翻译中…
$1 \leq N \leq 5000$$1 \leq A,B \leq N$- All values in input are integers.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N A B
翻译中…
Output
翻译中…
Print the number of different strings that $x$ can be after Snuke finishes doing operations, modulo $(10^9+7)$.
翻译中…
样例
Input #1
4 2 3
Output #1
11
For example, $x$ can be `0011` or `1111` in the end, but cannot be `0110`.
Input #2
10 7 2
Output #2
533
Input #3
1000 100 10
Output #3
828178524
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。