I was working on problem from like past day, I got WA in c++ in couple of test cases, as a result I switched to Python 3. 6 and that’s where I found a thing which can give you WA frequently. It is related to large numbers.
py print((2001100545* 2001100544)/2)
and doing it modulo with 10**9 + 7 will give
But if we do so with C++ or python 2x…
it will give
See the difference ^^.
In such cases python 2x will returns right answer because it have long type and interpreter automatically decides, which type i.e.
long is to be used.