Question: You can decompose a number greater than 0 as a unique sum of positive Fibonacci numbers. In this question we do this by repeatedly subtracting the **largest possible** positive Fibonacci number. E.g.:

```
1 = 1
2 = 2
3 = 3
4 = 3 + 1
12 = 8 + 3 + 1
13 = 13
100 = 89 + 8 + 3

```

Now, I call a *Fibonacci product* the same lists as above, but with the addition replaced by multiplication. For example, \$f(100) = 89 \times 8 \times 3 = 2136\$.

Write a program or function that given a positive integer *n* returns the Fibonacci product of that number.

---

Testcases:

```
1: 1
2: 2
3: 3
4: 3
5: 5
6: 5
7: 10
8: 8
9: 8
42: 272
1000: 12831
12345: 138481852236

```

Answer: 
[Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
==========================================================

```
ŒṗḟÐḟÆḞ€ṪP

```

[Try it online!](https://tio.run/##y0rNyan8///opIc7pz/cMf/wBBDR9nDHvEdNax7uXBXw//9/MwMA "Jelly – Try It Online")

Times out for \$n > 60\$

How it works
------------

```
ŒṗḟÐḟÆḞ€ṪP - Main link. Takes n on the left
Œṗ         - Integer partitions of n
     ÆḞ€   - First n Fibonacci numbers
   Ðḟ      - Keep the partitions p which yield an empty list under:
  ḟ        -   Remove all elements of p which are in the first n Fibonacci numbers
        Ṫ  - Take the last element
         P - Product

```
Javascript (ES6) ~~134~~ ~~106~~ 92 bytes
=========================================

Thanks for @cat for spotting a space.

```
n=>{for(c=[a=b=s=1,1];a+b<=n;)a+=b,c.unshift(b+=a,a);c.map(i=>i<=n&&(n-=i)&(s*=i));alert(s)}

```

Just an unoptimized version made on my phone, I golf it down, once I get home. Ideas are welcome.