New update is available. Click here to update.

Posted: 15 Oct, 2020

Difficulty: Moderate

```
N=3
```

```
We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
```

```
The first line contains an integer 'T', which denotes the number of test cases or queries to be run. Then the test cases follow.
The first and the only argument of each test case contains an integer 'N', representing the number of stairs.
```

```
For each test case/query, print the number of distinct ways to reach the top of stairs. Since the number can be huge, so return output modulo 10^9+7.
Output for every test case will be printed in a separate line.
```

```
You do not need to print anything. It has already been taken care of.
```

```
1 <= 'T' <= 10
0 <= 'N' <= 10^5
Where 'T' is the number of test cases, and 'N' is the number of stairs.
It is guaranteed that sum of 'N' over all test cases is <= 10^5.
```

Categories:

Popular Courses: