diff --git a/hard/day_13/problem.txt b/hard/day_13/problem.txt new file mode 100644 index 0000000..112d5cb --- /dev/null +++ b/hard/day_13/problem.txt @@ -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). \ No newline at end of file diff --git a/hard/day_13/solution.cpp b/hard/day_13/solution.cpp new file mode 100644 index 0000000..8d3ad8d --- /dev/null +++ b/hard/day_13/solution.cpp @@ -0,0 +1 @@ +//write your code here \ No newline at end of file diff --git a/hard/day_13/solution_test_cases.txt b/hard/day_13/solution_test_cases.txt new file mode 100644 index 0000000..21a7c9b --- /dev/null +++ b/hard/day_13/solution_test_cases.txt @@ -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. \ No newline at end of file