Icebound hates math. But Imp loves math. One day, Imp gave icebound a problem. The problem is as follows. S=modpS = mod pS=modp For given q,n,p, you need to help icebound to calculate the value of S.
Icebound hates math. But Imp loves math. One day, Imp gave icebound a problem. The problem is as follows. S=(∑i=1nqi) mod pS =(sum_{i=1}^n q^i) mod pS=(∑i=1nqi) mod p For given q,n,p, you need to help icebound to calculate the value of S.
(图片来源网络,侵删)