301129: CF209A. Multicolored Marbles
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Multicolored Marbles
题意翻译
给定一个长度为n的由两种不同颜色交替组成的序列 求总共有多少个由两种不同颜色交替组成的子序列。题目描述
Polycarpus plays with red and blue marbles. He put $ n $ marbles from the left to the right in a row. As it turned out, the marbles form a zebroid. A non-empty sequence of red and blue marbles is a zebroid, if the colors of the marbles in this sequence alternate. For example, sequences (red; blue; red) and (blue) are zebroids and sequence (red; red) is not a zebroid. Now Polycarpus wonders, how many ways there are to pick a zebroid subsequence from this sequence. Help him solve the problem, find the number of ways modulo $ 1000000007 $ $ (10^{9}+7) $ .输入输出格式
输入格式
The first line contains a single integer $ n $ $ (1<=n<=10^{6}) $ — the number of marbles in Polycarpus's sequence.
输出格式
Print a single number — the answer to the problem modulo $ 1000000007 $ $ (10^{9}+7) $ .
输入输出样例
输入样例 #1
3
输出样例 #1
6
输入样例 #2
4
输出样例 #2
11