Minimum number of square tiles required to fill the rectangular floor | C ++ implementation of above approach ; Function to find the number of tiles ; no of tiles ; Driver Code ; input length and breadth of rectangle and side of square
#include <bits/stdc++.h> NEW_LINE using namespace std ; int solve ( double M , double N , double s ) { int ans = ( ( int ) ( ceil ( M / s ) ) * ( int ) ( ceil ( N / s ) ) ) ; return ans ; } int main ( ) { double N = 12 , M = 13 , s = 4 ; cout << solve ( M , N , s ) ; return 0 ; }