Minimum squares to cover a rectangle | C ++ program to find the minimum number of squares to cover the surface of the rectangle with given dimensions ; function to count the number of squares that can cover the surface of the rectangle ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int squares ( int l , int b , int a ) { return ceil ( l / ( double ) a ) * ceil ( b / ( double ) a ) ; } int main ( ) { int l = 11 , b = 23 , a = 14 ; cout << squares ( l , b , a ) << endl ; return 0 ; }