| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 68 | 32 | 30 | 51.724% |
Let $f_{x} = c^{2x-6} \cdot f_{x-1} \cdot f_{x-2} \cdot f_{x-3}$ for $x \ge 4$.
You have given integers $n,ドル $f_{1},ドル $f_{2},ドル $f_{3},ドル and $c$. Find $f_{n} \bmod (10^{9}+7)$.
The only line contains five integers $n,ドル $f_{1},ドル $f_{2},ドル $f_{3},ドル and $c$ (4ドル \le n \le 10^{18},ドル 1ドル \le f_{1},ドル $f_{2},ドル $f_{3},ドル $c \le 10^{9}$).
Print $f_{n} \bmod (10^{9} + 7)$.
5 1 2 5 3
72900
17 97 41 37 11
317451037
In the first example, $f_{4} = 90,ドル $f_{5} = 72900$.
In the second example, $f_{17} \approx 2.28 \times 10^{29587}$.
Contest > Codeforces > Codeforces Round 566 (Div. 2) E번