title: Maximum Number Segments Lengths B C
signature: def maximumNumberSegmentsLengthsBC(n: Int, a: Int, b: Int, c: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, a: Int, b: Int, c: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n, a, b, c),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        23, 16, 23, 18, 
        1    
      )}")   
  
  
      println(s"TEST-1...${driver(
        62, 76, 81, 97, 
        -1    
      )}")   
  
  
      println(s"TEST-2...${driver(
        32, 46, 1, 78, 
        32    
      )}")   
  
  
      println(s"TEST-3...${driver(
        82, 48, 72, 58, 
        -1    
      )}")   
  
  
      println(s"TEST-4...${driver(
        94, 99, 62, 38, 
        -1    
      )}")   
  
  
      println(s"TEST-5...${driver(
        44, 21, 46, 60, 
        -1    
      )}")   
  
  
      println(s"TEST-6...${driver(
        4, 57, 2, 77, 
        2    
      )}")   
  
  
      println(s"TEST-7...${driver(
        53, 23, 80, 5, 
        7    
      )}")   
  
  
      println(s"TEST-8...${driver(
        9, 55, 26, 85, 
        -1    
      )}")   
  
  
      println(s"TEST-9...${driver(
        23, 15, 73, 42, 
        -1    
      )}")   
  
  }
  
source_py: def maximum_number_segments_lengths_b_c(n, a, b, c):
      dp = ([(- 1)] * (n + 10))
      dp[0] = 0
      for i in range(0, n):
          if (dp[i] != (- 1)):
              if ((i + a) <= n):
                  dp[(i + a)] = max((dp[i] + 1), dp[(i + a)])
              if ((i + b) <= n):
                  dp[(i + b)] = max((dp[i] + 1), dp[(i + b)])
              if ((i + c) <= n):
                  dp[(i + c)] = max((dp[i] + 1), dp[(i + c)])
      return dp[n]
source_cpp: int maximum_number_segments_lengths_b_c(int n, int a, int b, int c) {
    int dp [ n + 1 ];
    memset ( dp, - 1, sizeof ( dp ) );
    dp [ 0 ] = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      if ( dp [ i ] != - 1 ) {
        if ( i + a <= n ) dp [ i + a ] = max ( dp [ i ] + 1, dp [ i + a ] );
        if ( i + b <= n ) dp [ i + b ] = max ( dp [ i ] + 1, dp [ i + b ] );
        if ( i + c <= n ) dp [ i + c ] = max ( dp [ i ] + 1, dp [ i + c ] );
      }
    }
    return dp [ n ];
  }