#T154. Pell数列
Pell数列
Description
The Pell sequence is defined as follows: , , and for .
Given a positive integer , find the value of the -th term in the Pell sequence modulo 32767.
Input Format
The first line contains the number of test cases , followed by lines of input. Each test case consists of a single line containing a positive integer ().
Output Format
Output lines, each corresponding to an input. Each line should contain a non-negative integer.
2
1
8
1
408