title: Maximum Number 2X2 Squares Can Fit Inside Right Isosceles Triangle
signature: func maximumNumber2X2SquaresCanFitInsideRightIsoscelesTriangle(base_arg0 int) float64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual float64, expected float64) bool {
      return math.Abs(actual - expected) < 1e-06
  }
  
  func driver(base_arg0 int, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(base_arg0),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(95, 1104.375)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(49, 287.875)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(10, 10.0)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(73, 647.875)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(74, 666.0)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(40, 190.0)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(10, 10.0)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(94, 1081.0)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(64, 496.0)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(16, 28.0)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def maximum_number_2x2_squares_can_fit_inside_right_isosceles_triangle(base):
      base = (base - 2)
      base = (base / 2)
      return ((base * (base + 1)) / 2)
source_cpp: int maximum_number_2x2_squares_can_fit_inside_right_isosceles_triangle(int base) {
    base = ( base - 2 );
    base = base / 2;
    return base * ( base + 1 ) / 2;
  }