AtCoder Beginner Contest 245
Ex
Product Modulo 2
AtCoder
⌀ 3057
原题
←G →
翻译中…

Problem Statement

翻译中…

Among the sequences of length $K$ consisting of integers, $A=(A_1, \ldots, A_K)$, how many satisfy all of the conditions below? Find the count modulo $998244353$.

翻译中…
  • $0\leq A_i \leq M-1$ for every $i(1\leq i\leq K)$.
  • $\displaystyle\prod_{i=1}^{K} A_i \equiv N \pmod M$.
翻译中…

Constraints

翻译中…
  • $1 \leq K \leq 10^9$
  • $0 \leq N \lt M \leq 10^{12}$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

K N M

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
2 3 6
Output #1
5
The five sequences $A$ satisfying the conditions are $(1,3),(3,1),(3,3),(3,5),(5,3)$.
Input #2
10 0 2
Output #2
1023
Input #3
1000000000 20220326 1000000000000
Output #3
561382653
Be sure to find the count modulo $998244353$.
题目信息
题号
abc245_h
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。