Problem C
Linear Recurrences
Input
The first line of input contains an integer
The next line contains an integer
Output
For each query
Sample Input 1 | Sample Output 1 |
---|---|
2 0 1 1 0 1 6 1 100000 2 100000 3 100000 4 100000 5 100000 6 100000 |
1 1 2 3 5 8 |
Sample Input 2 | Sample Output 2 |
---|---|
2 5 7 9 36713 5637282 4 1 10000 1375 1 3781 23 34683447233 1571385 |
7282 0 16 299255 |
Sample Input 3 | Sample Output 3 |
---|---|
3 1 2 3 4 0 0 0 1 42424242424242 1000000 |
552200 |