# [ROIR 2023 Day 1] 斐波那契乘积
## 题目背景
翻译自 [ROIR 2023 D1T2](https://neerc.ifmo.ru/school/archive/2022-2023/ru-olymp-regional-2023-day1.pdf)。
斐波那契数指斐波那契数列($f_0=1,f_1=1,f_i=f_{i-2}+f_{i-1}$)中出现的数。
## 题目描述
给定一个自然数 $n$,求出将其表示为大于 $1$ 的斐波那契数的乘积的方式数量。
## 输入格式
第一行一个数 $t$,表示数据组数。
接下来 $t$ 行,每行输入一个数 $n$。
## 输出格式
对于每组测试数据,输出一个数表示答案。
## 样例 #1
### 样例输入 #1
```
5
2
7
8
40
64
```
### 样例输出 #1
```
1
0
2
2
3
```
## 提示
样例解释:
- $2=2$。
- $7$ 无法被表示为斐波那契乘积。
- $8=8=2\times2\times2$。
- $40=5\times8=2\times2\times2\times5$。
- $64=8\times8=2\times2\times2\times8=2\times2\times2\times2\times2\times2$。
本题使用捆绑测试。
| 子任务编号 | 分值 | $2\le n\le$ |
| :----------: | :----------: | :----------: |
| $1$ | $15$ | $100$ |
| $2$ | $17$ | $10^5$ |
| $3$ | $9$ | $n$ 是 $2$ 的整数次幂 |
| $4$ | $38$ | $10^9$ |
| $5$ | $21$ | $10^{18}$ |
对于所有数据,$1\le t\le50$,$2\le n\le10^{18}$。
#include<bits/stdc++.h>
using namespace std;
long long f[100],s;
void g(int x,long long y){
if(y==1){
s++;
return;
}
if(x==87)return;
if(y%f[x]==0)g(x,y/f[x]);
g(x+1,y);
}
int main()
{
f[0]=1,f[1]=1;
for(int i=2;i<=86;i++){
f[i]=f[i-1]+f[i-2];
}
int t;
long long n;
scanf("%d",&t);
while(t--){
scanf("%lld",&n);
s=0;
g(2,n);
printf("%d\n",s);
}
return 0;
}