text: Maximum of smallest possible area that can get with exactly k cut of given rectangular | C ++ code for Maximum of smallest possible area that can get with exactly k cut of given rectangular ; Utility Function ; for the 1 st case ; for the second case ; print final result ; driver code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; void max_area ( int n , int m , int k ) { if ( k > ( n + m - 2 ) ) cout << " Not ▁ possible " << endl ; else { int result ; if ( k < max ( m , n ) - 1 ) { result = max ( m * ( n / ( k + 1 ) ) , n * ( m / ( k + 1 ) ) ) ; } else { result = max ( m / ( k - n + 2 ) , n / ( k - m + 2 ) ) ; } cout << result << endl ; } } int main ( ) { int n = 3 , m = 4 , k = 1 ; max_area ( n , m , k ) ; }