title: Split N Maximum Composite Numbers
signature: func splitNMaximumCompositeNumbers(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(55, 12)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(35, 7)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(24, 6)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(75, 17)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(5, -1)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(7, -1)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(50, 12)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(28, 7)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(67, 15)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(59, 13)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def split_n_maximum_composite_numbers(n):
      if (n < 4):
          return (- 1)
      rem = (n % 4)
      if (rem == 0):
          return (n // 4)
      if (rem == 1):
          if (n < 9):
              return (- 1)
          return (((n - 9) // 4) + 1)
      if (rem == 2):
          return (((n - 6) // 4) + 1)
      if (rem == 3):
          if (n < 15):
              return (- 1)
          return (((n - 15) // 4) + 2)
source_cpp: int split_n_maximum_composite_numbers(int n) {
    if ( n < 4 ) return - 1;
    int rem = n % 4;
    if ( rem == 0 ) return n / 4;
    if ( rem == 1 ) {
      if ( n < 9 ) return - 1;
      return ( n - 9 ) / 4 + 1;
    }
    if ( rem == 2 ) return ( n - 6 ) / 4 + 1;
    if ( rem == 3 ) {
      if ( n < 15 ) return - 1;
      return ( n - 15 ) / 4 + 2;
    }
  }