No.8036 Restricted Lucas (Easy)
タグ : / 解いたユーザー数 33
作問者 :
Preface
This problem is a memorial to https://codeiq.jp/q/1603 (※ That problem was never published, so this URL cannot be accessed even if you have a CodeIQ account.)
Problem Statement
The Lucas sequence is the sequence
L(0)=2,L(1)=1,L(2)=3,L(3)=4,L(4)=7,...
that satisfies L(N+2)=L(N)+L(N+1).
Find the N-th term of this sequence modulo 1000000007. However, writing the following characters in your source code is forbidden.
0 1 2 3 4 5 6 7 8 9 \ " ' * / %
Technical Note (you do not need to read this if you do not need it; it is not directly related to this problem)
The statement "Vn (1, -1) is the (ordinary) Lucas numbers" found at https://ja.wikipedia.org/wiki/%E3%83%AA%E3%83%A5%E3%82%AB%E6%95%B0%E5%88%97 refers to the same sequence as the Lucas sequence in this problem.
Input
T N1 N2 … NT
T: the number of test cases
Ni (1<=i<=T): the index of the term of the Lucas sequence to be found
1 <= T <= 100
1 <= Ni <= 2000000000
Output
For each line, output the Ni-th term of the Lucas sequence modulo 1000000007.
Print a newline at the end.
Sample
Sample 1
Input
3 10 43 2000000000
Output
123 969323029 2207
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。