In this problem ultimately we have to find (b*(b-1)^(a-1))%mod as you have written. There is this property of modulo which we will use that (a*b)%c = ((a%c)*(b% ...
確定! 回上一頁