Problem2137--劝君序列

2137: 劝君序列

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 83  Solved: 64
[Status] [Submit] [Creator:]

Description

劝君序列是一个数列 a1, a2, a3, ……

其满足:
· a1 = 1
· a2 = 2
· a3 = 3
· 当 i>3 时,ai = ai-1 + 2 × ai-2 - 3 × ai-3

请你求出劝君序列的前 n 个元素。

Input

一个整数 n(1 ≤ n ≤ 50)。

Output

输出共一行,包含 n 个整数 a1, a2, a3, ……, an,两两之间以一个空格分隔。

Sample Input Copy

10

Sample Output Copy

1 2 3 4 4 3 -1 -7 -18 -29

Source/Category

 提高C