8971: [ysupo] $\sum_{i=0}^{n-1} r^i i^d$
[Creator : ]
Description
Given integers $r$, $d$ and $n$, calculate $\sum_{i=0}^{n-1} r^i i^d$ modulo $998244353$.
We define $0^0 = 1$.
We define $0^0 = 1$.
Input
$r$ $d$ $n$
Output
$\mathit{answer}$
Constraints
$0 \le r <998244353$
$0 \le d \le 10^7$
$0 \le n \le 10^{18}$
$0 \le d \le 10^7$
$0 \le n \le 10^{18}$
Sample 1 Input
2 5 8
Sample 1 Output
2767418