title: Maximum Number Of Squares That Can Be Fit In A Right Angle Isosceles Triangle
signature: func maximumNumberOfSquaresThatCanBeFitInARightAngleIsoscelesTriangle(b int, m 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-09
  }
  
  func driver(b int, m int, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(b, m),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(40, 
  	74, -0.1241782322863404)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(38, 
  	35, 0.04653061224489791)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(47, 
  	71, -0.11188256298353501)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(52, 
  	29, 0.7110582639714625)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(21, 
  	9, 1.5555555555555558)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(50, 
  	33, 0.3902662993572084)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(8, 
  	82, -0.04402141582391434)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(56, 
  	80, -0.10500000000000001)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(93, 
  	5, 163.68000000000004)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(21, 
  	90, -0.08944444444444444)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def maximum_number_of_squares_that_can_be_fit_in_a_right_angle_isosceles_triangle(b, m):
      return ((((b / m) - 1) * (b / m)) / 2)
source_cpp: int maximum_number_of_squares_that_can_be_fit_in_a_right_angle_isosceles_triangle(int b, int m) {
    return ( b / m - 1 ) * ( b / m ) / 2;
  }