| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2.5 초 | 256 MB | 58 | 12 | 10 | 20.833% |
Let us fix an integer $m$. Consider an array $a$ consisting of $n$ positive integers. The array $a$ is fancy if each number in $a$ is a divisor of $m,ドル and each two neighboring numbers in $a$ are not coprime.
Find the total number of fancy arrays of length $n$. As the answer may be large, find it modulo 10ドル^{9} + 7$.
The first line contains two integers, $m$ and $q$: the number introduced above and the number of queries (1ドル \le m \le 10^{16},ドル 1ドル \le q \le 150$).
Each of the next $q$ lines contains a single integer $n$ (1ドル \le n \le 10^{18}$).
For each query, print the number of fancy arrays for the given $m$ and $n$ modulo 10ドル^{9} + 7$.
12 3 1 2 3
6 21 91