#P10095. [ROIR 2023] 斐波那契乘积 (Day 1)

    ID: 10753 远端评测题 1000ms 512MiB 尝试: 7 已通过: 0 难度: 5 上传者: 标签>搜索数学递归2023Special Judge枚举深度优先搜索 DFSFibonacci 数列ROIR(俄罗斯)

[ROIR 2023] 斐波那契乘积 (Day 1)

Background

Translated from ROIR 2023 D1T2

A Fibonacci number refers to a number appearing in the Fibonacci sequence (f0=1,f1=1,fi=fi2+fi1f_0=1,f_1=1,f_i=f_{i-2}+f_{i-1})。

Problem Description

Given a natural number nn, find the number of ways to represent it as a product of several Fibonacci numbers greater than 11

Input Format

The first line contains an integer tt, representing the number of test cases。

The next tt lines each contain one integer nn

Output Format

For each test case, output one integer representing the answer。

5
2
7
8
40
64
1
0
2
2
3

Hint

Explanation of the samples:

  • 2=22=2
  • 77 cannot be represented as a Fibonacci product。
  • 8=8=2×2×28=8=2\times2\times2
  • 40=5×8=2×2×2×540=5\times8=2\times2\times2\times5
  • $64=8\times8=2\times2\times2\times8=2\times2\times2\times2\times2\times2$。

This problem uses bundled testdata。

Subtask ID Score 2n2\le n\le
11 1515 100100
22 1717 10510^5
33 99 nn is an integer power of 22
44 3838 10910^9
55 2121 101810^{18}

For all testdata, 1t501\le t\le502n10182\le n\le10^{18}

Translated by ChatGPT 5