Number of squares of side length required to cover an N * M rectangle | function to find a number of squares of a * a required to cover n * m rectangle ; Driver code ; Function call
function Squares ( n , m , a ) { return parseInt ( ( ( m + a - 1 ) / a ) ) * parseInt ( ( ( n + a - 1 ) / a ) ) ; } var n = 6 , m = 6 , a = 4 ; document . write ( Squares ( n , m , a ) ) ;