GCD Property for competitive programming -
The remainder obtained after the division operation on two operands is known as modulo operation. Operator for doing modulus operation is ‘%’. For ex: a % b = c which means, when a is divided by b it gives the remainder c, 7%2 = 1, 17%3 = 2.
Important properties of modulo-
If you take mod after the final (actual) answer it would defeat the very purpose of using the mod operator in the question.