How to calculate $(\sum_{k=1}^{N} k^{x} x^{k}) \bmod M$?↵
↵
Constraints are $1 \le N, M \le 2 * 10^{9}$ and $1 \le x \le 50$ and time limit is 1 second.↵
↵
Please can someone help?
↵
Constraints are $1 \le N, M \le 2 * 10^{9}$ and $1 \le x \le 50$ and time limit is 1 second.↵
↵
Please can someone help?