Help needed in CSES Problemset : Problem Exponentiation II

Revision en1, by sahal, 2020-10-01 17:42:20

Problem

Solution

I don't understand line 24. Why M-1 is used instead of M? Please help me to understand. Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English sahal 2020-10-01 17:42:20 313 Initial revision (published)