$\sum_{i=0}^{n-1} r^i i^d$

AC一覧

Problem Statement
問題文

Given integers $r$, $d$ and $n$, calculate $\sum_{i=0}^{n-1} r^i i^d$ modulo $998{,}244{,}353$. We define $0^0 = 1$.

Constraints
制約

Input
入力

$r$ $d$ $n$

Output
出力

$\mathit{answer}$

Sample
サンプル

# 1

2 5 8
2767418

Forum


Timelimit: 5 secs

Before submitting, please confirm terms and conditions