Help needed in CSES Problemset : Problem Exponentiation II
Problem
Solution
I don't understand line 24. Why M-1 is used instead of M? Please help me to understand. Thanks in advance.
Atcoder ABC #351 Short Solution Discussion
Codeforces Round 941 (Div 1 + 2) Solution Discussion (with Jan)