getting the actual sum as we shifted the numbers by / 50 to avoid negative indexing in array
int temp = i - 50 * n ; max_value = Math . max ( max_value , temp * ( sum - temp ) ) ; min_value = Math . min ( min_value , temp * ( sum - temp ) ) ; } } System . out . print ( " Maximum ▁ Value : ▁ " + ( int ) max_value + "NEW_LINE" +  " Minimum ▁ Value : ▁ " + ( int ) min_value + "NEW_LINE"); }