You are playing a board game. The game consists of \(q\) cards. The \(i^{th}\) card is a table with the following features:
- \(3\) rows numbered from \(1\) to \(3\), considering the bottom to top approach
- \(N\) columns numbered from \(1\) to \(n\), considering the left to right approach
In each move, you can move from a block with coordinates \((x,y)\) to either of the following coordinates:
- \((x+1, y+1)\)
- \((x+1, y-1)\)
You want to know the number of ways you can move from the block \((1,1)\) to block \((n_i,3)\).
Note: Print the answer \(modulo\ 10^9+7\).
Input format
- First line: Integer \(q\) denoting the number of cards
- Next \(q\) lines: \(i^{th}\) card containing one integer \(n_i \)denoting the size of the \(i^{th}\) card
Output format
In \(q\) lines, print the answer that represents the number of ways you can move from the block \((1,1)\) to block \((n_i,3)\).
Constraints
3 3 2 5
1 0 2
There is only one way to go from $$(1,1)$$ to $$(3,3)$$ and that is $$[(1,1),(2,2),(3,3)]$$.
There is no way to go from $$(1,1)$$ to $$(2,3)$$.
There are 2 ways to go from $$(1,1)$$ to $$(5,3)$$.
- $$[(1,1),(2,2),(3,3),(4,2),(5,3)]$$
- $$[(1,1),(2,2),(3,1),(4,2),(5,3)]$$
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor