D. 斐波那契数列

    Type: RemoteJudge 1000ms 128MiB

斐波那契数列

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

斐波那契数列是指这样的数列:数列的第一个和第二个数都为 11,接下来每个数都等于前面 22 个数之和。

给出一个正整数 aa,要求斐波那契数列中第 aa 个数是多少。

输入格式

11 行是测试数据的组数 nn,后面跟着 nn 行输入。每组测试数据占 11 行,包括一个正整数 aa1a301 \le a \le 30)。

输出格式

输出有 nn 行,每行输出对应一个输入。输出应是一个正整数,为斐波那契数列中第 aa 个数的大小。

4
5
2
19
1
5
1
4181
1

暑假C三

Not Attended
Status
Done
Rule
IOI
Problem
5
Start at
2025-7-20 14:45
End at
2025-7-20 16:45
Duration
2 hour(s)
Host
Partic.
9