#Lutece2746. Rust
Rust
Migrated from Lutece 2746 Rust
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
纯音乐,请您欣赏。
——《Rust》
有一 阶多项式
对于给定正整数 ,求
的值,对 取模。
Input
第一行三个正整数 。
第二行 个整数 ,表示多项式的系数。保证 。
Output
输出一行一个整数表示 的值,对 取模。
Samples
5 1 4
1 1
7737
Note
多项式为
则
$$\begin{aligned} S(5)&=\sum_{k=0}^5 4^kf(k)\\ &=4^0f(0)+4^1f(1)+4^2f(2)+4^3f(3)+4^4f(4)+4^5f(5)\\ &=1\times 1+4\times 2+16\times 3+64\times 4+256\times 5+1024\times 6\\ &=7737 \end{aligned} $$Resources
2022 UESTC ICPC Training for Math and Geometry