Question: https://hack.codingblocks.com/contests/c/452/1103
My code: https://ide.codingblocks.com/#/s/18697
It gives correct answer for all test cases except 2 and 3. I checked for large values 2,147,483,646. Everything seems fine to me. Please point out my mistake in the code.
TIA!