Why answer for 22 should be 482563003 when the actual answer is 597661206 ??
Wrong answer for 22?
akash.maurya
#2
Check if at any place your (int*int) is crossing the range of Integer.
Switch to long it will fix.