Fibonacci Numbers | ||||||
| ||||||
Description | ||||||
We all know Fibonacci Numbers: F0=1, F1=1, F2=F1+F2, ..., Fi=F(i-1)+F(i-2). Now, given a positive integer n(0<=n<=1000 000 000), can you find three different Fibonacci number Fa, Fb, Fc(a<b<c), which can make n=Fa+Fb+Fc?
| ||||||
Input | ||||||
There are multiple test cases. The first line is an integer T indicating the number of test cases. Each test case has one line, with a positive integer n. | ||||||
Output | ||||||
If there is any Fa, Fb, Fc, which can suffice n = Fa+Fb+Fc, output Fa, Fb, Fc in one line. If there are multiple groups, output the smaller one by lexicographical order. If there is no sufficed group output "Not Found!". | ||||||
Sample Input | ||||||
9 1 2 3 4 5 6 7 8 9 | ||||||
Sample Output | ||||||
Not Found! Not Found! Not Found! 1 1 2 1 1 3 1 2 3 1 1 5 1 2 5 1 3 5 fib数列到第45个会超过10e9,暴力跑一边就可以
|
Hust oj 1720 Fibonacci Numbers(水题)
最新推荐文章于 2020-07-24 19:32:54 发布