#K95617. Plant Arrangement Problem

    ID: 38904 Type: Default 1000ms 256MiB

Plant Arrangement Problem

Plant Arrangement Problem

In this problem, you are given an integer (N) that represents the number of plants. The plants need to be arranged in a row such that the arrangement follows a recurrence relation: [ \text{dp}[n] = \text{dp}[n-1] + \text{dp}[n-2] \pmod{10^9+7}, \quad n \ge 3, ] with base cases: [ \text{dp}[1] = 1, \quad \text{dp}[2] = 2 \quad (\text{if } N \ge 2). ] For a given test case, output the number of arrangements for the provided (N) following the formula above. You will be given (T) test cases. Each test case consists of a single integer (N). The answer for each test case must be computed modulo (10^9+7).

inputFormat

The input is read from standard input (stdin). The first line contains a single integer (T) representing the number of test cases. Each of the next (T) lines contains an integer (N) which represents the number of plants.

outputFormat

For each test case, output the number of ways to arrange the plants modulo (10^9+7) on a new line to the standard output (stdout).## sample

1
1
1

</p>