| 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 发布


&spm=1001.2101.3001.5002&articleId=52435368&d=1&t=3&u=683c2c1838894dafbb0b61e39a86b38d)
523

被折叠的 条评论
为什么被折叠?



