~/algor $ cat problems/while-fibonachchi-yoyilmasi
Fibonacci decomposition
Medium
1000 ms
64 MB
49%
The Fibonacci numbers: $1, 2, 3, 5, 8, 13, 21, \dots$ — each is the sum of the previous two. A positive integer $n$ is decomposed as follows: the largest Fibonacci number not exceeding $n$ is written down and subtracted from $n$; this is repeated until $n$ becomes zero. Find the numbers written down (for example, $100 = 89 + 8 + 3$).
Input
One positive integer $n$.
Output
One line with the Fibonacci numbers separated by spaces, in decreasing order (in the order they were written).
Note
$1 \le n \le 10^{18}$
Examples
Input #1
100
Output #1
89 8 3
Input #2
64
Output #2
55 8 1