Skip to content

Commit

Permalink
chore: day_13
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemincoder authored Apr 5, 2024
1 parent c0513c1 commit 53a3349
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hard/day_13/problem.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Bluemin is engaged in a game with red and blue marbles. He has arranged n marbles in a row from left to right.
Surprisingly, the arrangement forms a zebroid.

A zebroid is a non-empty sequence of red and blue marbles where the colors alternate.
For instance, sequences like (red; blue; red) and (blue) are zebroids, while (red; red) is not.

Now Bluemin ponders over the number of ways to select a zebroid subsequence from this arrangement.
He seeks your assistance in solving this intriguing puzzle and finding the count modulo 1000000007 (10^9 + 7).

Input

The first line presents a single integer n (1 ≤ n ≤ 10^6), indicating the count of marbles in Bluemin's sequence.

Output

Your task is to print a single number, the answer to the problem modulo 1000000007 (10^9 + 7).
1 change: 1 addition & 0 deletions hard/day_13/solution.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//write your code here
23 changes: 23 additions & 0 deletions hard/day_13/solution_test_cases.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Examples

Input
3
Output
6

Input
4
Output
11

Note:
Let's consider the first test sample. Let's assume that Bluemin initially had sequence (red; blue; red), so there are six ways to pick a zebroid:

pick the first marble;
pick the second marble;
pick the third marble;
pick the first and second marbles;
pick the second and third marbles;
pick the first, second and third marbles.

It can be proven that if Bluemin picks (blue; red; blue) as the initial sequence, the number of ways won't change.

0 comments on commit 53a3349

Please sign in to comment.