Minimum Sum of Values by Dividing Array