{"problem":{"name":"Power Pair","description":{"content":"Given is a prime number $P$. How many pairs of integers $(x, y)$ satisfy the following conditions? *   $0 \\leq x \\leq P-1$ *   $0 \\leq y \\leq P-1$ *   There exists a positive integer $n$ such that $x","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc212_g"},"statements":[{"statement_type":"Markdown","content":"Given is a prime number $P$.\nHow many pairs of integers $(x, y)$ satisfy the following conditions?\n\n*   $0 \\leq x \\leq P-1$\n*   $0 \\leq y \\leq P-1$\n*   There exists a positive integer $n$ such that $x^n \\equiv y \\pmod{P}$.\n\nSince the answer may be enormous, print it modulo $998244353$.\n\n## Constraints\n\n*   $2 \\leq P \\leq 10^{12}$\n*   $P$ is a prime number.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$P$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc212_g","tags":[],"sample_group":[["3","4\n\nFour pairs $(x, y) = (0, 0), (1, 1), (2, 1), (2, 2)$ satisfy the conditions."],["11","64"],["998244353","329133417"]],"created_at":"2026-03-03 11:01:13"}}