title: Recursively Break Number 3 Parts Get Maximum Sum 1
signature: class Solution {
  
      public Integer recursivelyBreakNumber3PartsGetMaximumSum1(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(50, 57);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(83, 93);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(18, 19);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(24, 27);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(31, 32);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(38, 41);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(94, 104);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(24, 27);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(13, 13);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(53, 57);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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 ];
  }