408402: GYM103114 F Fstee1XD and Minioins

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Fstee1XD and Minioinstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

In 2021, the story of Despicable Me is staged on Sstee1XD. The difference is that due to the mutation of the minion's DNA and the mistakes in population control, the number of minions in the backyard of Sstee1XD has exploded exponentially. No one has a solution, Sstee1XD can only ask you to help count the number of minions.

Suppose that on the first day, the first minion was born in the backyard of Sstee1XD's house. Every day thereafter, each minion will reproduce more minions.The law of reproduction is that each minion will reproduce $$$i$$$ minions on the $$$i$$$-th day after birth.

Input

The first line contains one integer $$$T(1 \leq T \leq 10^5)$$$, which represents the number of test case.

For each test case, the first line consists of one integer $$$n (1 \leq n\leq 10^{18})$$$, The number of days of reproduction of minions.

Output

For each test case, output an integer representing the total number of minions on n-th day.Since the answer can be very large, you have output it modulo $$$10^9+7$$$.

ExamplesInput
3
1
2
3
Output
1
2
5
Input
1
1000000000000000000
Output
761203726
Note

This picture is an explanation of the first example:

  • On the first day, 1-th minion was born, so the total number of minions on the first day was 1.
  • On the second day, because 1-th minion had existed for one day, it reproduction 2-th minion, so the total number of minions on the second day was 2.
  • On the third day, because 1-th minion had existed for two days, it reproduction 3-th minion and 4-th minion; because 2-th minion had existed for one day, it reproduction 5-th minion, so the total number of minions on the third day was 5.

加入题单

算法标签: