title: Recursively Break Number 3 Parts Get Maximum Sum 1
signature: func recursivelyBreakNumber3PartsGetMaximumSum1(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(50, 57)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(83, 93)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(18, 19)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(24, 27)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(31, 32)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(38, 41)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(94, 104)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(24, 27)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(13, 13)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(53, 57)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def recursively_break_number_3_parts_get_maximum_sum_1(n):
      dp = ([0] * (n + 1))
      dp[0] = 0
      dp[1] = 1
      for i in range(2, (n + 1)):
          dp[i] = max(((dp[int((i / 2))] + dp[int((i / 3))]) + dp[int((i / 4))]), i)
      return dp[n]
source_cpp: int recursively_break_number_3_parts_get_maximum_sum_1(int n) {
    int dp [ n + 1 ];
    dp [ 0 ] = 0, dp [ 1 ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) dp [ i ] = max ( dp [ i / 2 ] + dp [ i / 3 ] + dp [ i / 4 ], i );
    return dp [ n ];
  }