 ## On the Subject of Cruel Modulo

Remember that super easy mathematical module? Here’s his evil twin.

• This modulo shows three numbers, a keypad, and a small screen at the bottom which will display the answer.
• Take the larger central number (n), raise it to the power of the smaller number in the top right (p), and then modulo this result by the smaller number in the top left (m).
• To perform the modulo operation, multiply n by itself p times, then take this number subtract m from it repeatedly until it is less than m.
• Alternatively, divide n^p by m and take the remainder.
• Whichever method you prefer to use, once you have calculated the correct answer, enter it into the keypad and press the green submit button. The module will only process if at least a digit is inputted.
• Entering the correct answer will disarm the module. Entering an incorrect answer will cause a strike and reset both m and n, but NOT p.

For an alternative method:

1. Take n, modulo m.
2. Let a variable, t, equals 1.
3. Take the result, multiplied by n, modulo m.