Sherlock and Queries
Div Mod
The modulo operation is one of the most primitive things along with arithmetic operations on integers.
or is the remainder when is divided by .
if it means m divides a such that for some multiple k,
Some of the properties are
This operation is very useful when computation involves very large numbers and to check correctness we usually perform computation under modulo operation, hence keeping variables in standard integer size limits.
Modulo operation is also useful useful in the following:
- Chinese Remainder Theorm
- Fast Modulo exponentiation
- Inverse modulo operation
Related challenge for Div Mod