title: Maximum Value Choice Either Dividing Considering
signature: function maximum_value_choice_either_dividing_considering(n)
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 ];
  }
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(n, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(3, 3)
      print(string.format("TEST-0...%s",result))
  
      result = driver(19, 24)
      print(string.format("TEST-1...%s",result))
  
      result = driver(39, 57)
      print(string.format("TEST-2...%s",result))
  
      result = driver(89, 152)
      print(string.format("TEST-3...%s",result))
  
      result = driver(96, 192)
      print(string.format("TEST-4...%s",result))
  
      result = driver(68, 114)
      print(string.format("TEST-5...%s",result))
  
      result = driver(48, 83)
      print(string.format("TEST-6...%s",result))
  
      result = driver(5, 5)
      print(string.format("TEST-7...%s",result))
  
      result = driver(3, 3)
      print(string.format("TEST-8...%s",result))
  
      result = driver(4, 4)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 3, "inputs": {"n": 3}}, {"idx": 1, "outputs": 24, "inputs": {"n": 19}}, {"idx": 2, "outputs": 57, "inputs": {"n": 39}}, {"idx": 3, "outputs": 152, "inputs": {"n": 89}}, {"idx": 4, "outputs": 192, "inputs": {"n": 96}}, {"idx": 5, "outputs": 114, "inputs": {"n": 68}}, {"idx": 6, "outputs": 83, "inputs": {"n": 48}}, {"idx": 7, "outputs": 5, "inputs": {"n": 5}}, {"idx": 8, "outputs": 3, "inputs": {"n": 3}}, {"idx": 9, "outputs": 4, "inputs": {"n": 4}}]
question_info.extension: lua
question_info.entry_fn_name: maximum_value_choice_either_dividing_considering
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__