Number of squares of side length required to cover an N * M rectangle | function to find number of squares of a * a required to cover n * m rectangle ; Driver code ; function call
< ? php function Squares ( $ n , $ m , $ a ) { return ( ( int ) ( ( $ m + $ a - 1 ) / $ a ) ) * ( ( int ) ( ( $ n + $ a - 1 ) / $ a ) ) ; } $ n = 6 ; $ m = 6 ; $ a = 4 ; echo Squares ( $ n , $ m , $ a ) ; ? >