問題一覧 > ネタ問題

No.8036 Restricted Lucas (Easy)

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 256 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 33
作問者 : ciel
お気に入りにしたユーザー ProblemId : 2166 / 自分の提出
問題文最終更新日: 2020-04-01 19:14:18
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder April fool contest 2018 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。