Maximum number of squares that can fit in a right angle isosceles triangle | function for finding max squares ; return in O ( 1 ) with derived formula ; Driver Code
< ? php function maxSquare ( $ b , $ m ) { return ( $ b / $ m - 1 ) * ( $ b / $ m ) / 2 ; } $ b = 10 ; $ m = 2 ; echo maxSquare ( $ b , $ m ) ;