how to solve this?
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.
Hey can you help me in this . i am getting wa in 3 test cases.