取余运算满足以下规则:(x + y) % p = (x % p + y % p) % p
证明如下:
假设:
x = a * p + b;
y = c * p + d;
则:
x % p = b;
y % p = d;
则:
(x + y) % p = (a * p + b + c * p + d) % p
= ((a + c) * p + (b + d)) % p
= (b + d) % p
= (x % p + y % p) % p