title: Recursively Break Number 3 Parts Get Maximum Sum
signature: func recursivelyBreakNumber3PartsGetMaximumSum(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(39, 41)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(79, 87)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(7, 7)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(76, 87)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(48, 57)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(18, 19)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(58, 63)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(17, 17)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(36, 41)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(5, 5)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def recursively_break_number_3_parts_get_maximum_sum(n):
      if ((n == 0) or (n == 1)):
          return n
      return max(((recursively_break_number_3_parts_get_maximum_sum((n // 2)) + recursively_break_number_3_parts_get_maximum_sum((n // 3))) + recursively_break_number_3_parts_get_maximum_sum((n // 4))), n)
source_cpp: int recursively_break_number_3_parts_get_maximum_sum(int n) {
    if ( n == 0 || n == 1 ) return n;
    return max ( ( recursively_break_number_3_parts_get_maximum_sum ( n / 2 ) + recursively_break_number_3_parts_get_maximum_sum ( n / 3 ) + recursively_break_number_3_parts_get_maximum_sum ( n / 4 ) ), n );
  }