{"problem":{"name":"Geometric Progression","description":{"content":"Given integers $A$, $X$, and $M$, find $\\displaystyle \\sum_{i = 0}^{X-1} A^i$, modulo $M$.","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc293_e"},"statements":[{"statement_type":"Markdown","content":"Given integers $A$, $X$, and $M$, find $\\displaystyle \\sum_{i = 0}^{X-1} A^i$, modulo $M$.\n\n## Constraints\n\n*   $1 \\leq A, M \\leq 10^9$\n*   $1 \\leq X \\leq 10^{12}$\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$A$ $X$ $M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc293_e","tags":[],"sample_group":[["3 4 7","5\n\n$3^0 + 3^1 + 3^2 + 3^3 = 40$, which equals $5$ modulo $7$, so $5$ should be printed."],["8 10 9","0"],["1000000000 1000000000000 998244353","919667211"]],"created_at":"2026-03-03 11:01:14"}}