Timer is Running

Associated Course(s):
Geeks Classes
Geeks Classes- Algorithms

Given **N**, the number of plots on either sides of the road. Find the total ways to construct buildings in the plots such that there is a space between any 2 buildings. All plots on one side of the road are continuous.

Lets suppose ‘*’ represents a plot, then for N=3, the plots can be represented as * * * | | * * *

Where | | represents the road.

Note: As the answer can be very large, print it mod 1000000007

**Input:**

First line of input contains **T** denoting number of test cases. Only line of each test case contains one integers** N, **as described above.

**Output:**

For each test case output a single line containing one integer, the answer to the above problem.

**Constraints:**

1<= T <= 100000

1<= N <= 10^{5}

**Example:
Input:**

1

3

**Output:**

25

**Explanation:**

3 plots, which means possible ways for one side are BSS, BSB, SSS, SBS, SSB where B represents a building and S represents an empty space

Total possible ways are 25, because a way to place on one side can correspond to any of 5 ways on other side.

Author: tanujyadav97

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

op_manish | 189 |

ArpitGupta8 | 163 |

lone_walker | 160 |

Prince_Singh | 154 |

KshamaGupta | 154 |

saiujwal13083 | 728 |

ppsvikhyat17 | 712 |

generic_coder | 630 |

reclone_rk | 479 |

vt9941 | 479 |

blackshadows | 5448 |

Ibrahim Nash | 5438 |

akhayrutdinov | 5111 |

mb1973 | 4976 |

Quandray | 4752 |

Login to report an issue on this page.