getting the actual sum as we shifted the numbers by / 50 to avoid negative indexing in array
var temp = i - 50 * n ; max_value = Math . max ( max_value , temp * ( sum - temp ) ) ; min_value = Math . min ( min_value , temp * ( sum - temp ) ) ; } } document . write ( " " + max_value + " " + " " + min_value ) ; }