Kindly provide the long datatype for questions in c++ rather that int. There are so many questions in which testcases have inputs like INT_MAX and INT_MIN and any operations like addition or multiplication on these will result in overflow.
Also we cannot change the function return type since the hidden code is expecting an int value.