how to solve this?
2 Likes
This was a nice problem, see errichtos stream for the explanation.
why wrong ans
when subtracting do ans=(ans-x+MOD)%MOD
Probably this is the mistake.
2 Likes
It worked.
Ty