QOJ.ac

QOJ

시간 제한: 1 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓

#18691. 簡単な計算

통계

$f(x)$ を、$1 \leq y \leq x$ かつ $\gcd(x,y)=1$ を満たす整数 $y$ の個数と定義する。ただし、$\gcd(x,y)$ は $x$ と $y$ の最大公約数である。

$g(x) = k \cdot f(x)$ と定義する。

$t>1$ のとき $g^{(t)}(x)=g(g^{(t-1)}(x))$ と定義し、$g^{(1)}(x)=g(x)$ とする。

$g^{(t)}(n) \bmod 998\,244\,353$ を求めよ。

入力

入力は一行のみであり、三つの整数 $n,k,t$ が与えられる ($1 \leq n,k,t \leq 998\,244\,352$)。

出力

答えを $998\,244\,353$ で割った余りを出力せよ。

入出力例

入力例 1

5 3 4

出力例 1

12

入力例 2

114514 1919 810

出力例 2

565299374

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.