Description
Scientists have recently discovered an unknown species that has a strong reproductive capacity and will have reproductive capacity from the fourth day of birth, and will breed two new individuals every day. The scientist put a newborn creature in a petri dish, and he wants to know how many of the creature will exist in the petri dish after N days (assuming that the creature will not die during this period ).
-
Input
-
The first act is an integer T, indicating the number of data groups.
For each group of test data:
Only one row, one integer n (n <= 100) is the number of days.
-
Output
-
For each group of test data to output a row, because the final result is very large, scientists only want to know the value of the last six digits.
-
Sample Input
-
2
-
5
-
100
-
Sample output
-
5
-
653399
Simulate the question and find the rule.
# Include <stdio. h> main () {int number; int N, J; int f [101]; F [1] = f [2] = f [3] = 1; f [4] = 3; for (j = 5; j <= 100; j ++) f [J] = (F [J-1] + F [J-3] * 2) % 1000000; scanf ("% d", & N); For (j = 0; j <n; j ++) {scanf ("% d", & number ); printf ("% d \ n", F [number]) ;}}