Change type of mercymin to 'int' to avoid gcc sign-compare warning.