可能就我这个申必会犯这样的错。
在 int 类型下,(x+y×type+mod)%mod(x+y \times type+mod) \% mod(x+y×type+mod)%mod 在 type=1type=1type=1 时会爆 int,需要先把前面取模。