Given A stairs and you are standing at the bottom(0th stair)
In a single step you can perform any one of the following operations:
a)Climb 1 stair
b)Climb 2 stairs
3)Climb 3 stairs
But you can climb 3 stairs in a single step at most 8 times. Find the number of ways to reach Ath Stair modulo 10^9+7
How to code this in c++
A =4 B=0
Answer - 5
There are 5 possible ways to reach the 4th stair
[1,1,1,1],[1,1,2],[1,2,1],[2,1,1],[2,2]