title: Maximum Value Choice Either Dividing Considering
signature: func maximumValueChoiceEitherDividingConsidering(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(3, 3)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(19, 24)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(39, 57)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(89, 152)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(96, 192)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(68, 114)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(48, 83)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(5, 5)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(3, 3)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(4, 4)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def maximum_value_choice_either_dividing_considering(n):
      res = list()
      res.append(0)
      res.append(1)
      i = 2
      while (i < (n + 1)):
          res.append(max(i, (((res[int((i / 2))] + res[int((i / 3))]) + res[int((i / 4))]) + res[int((i / 5))])))
          i = (i + 1)
      return res[n]
source_cpp: int maximum_value_choice_either_dividing_considering(int n) {
    int res [ n + 1 ];
    res [ 0 ] = 0;
    res [ 1 ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) res [ i ] = max ( i, ( res [ i / 2 ] + res [ i / 3 ] + res [ i / 4 ] + res [ i / 5 ] ) );
    return res [ n ];
  }