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: using System ; class GFG { static void max_area ( int n , int m , int k ) { if ( k > ( n + m - 2 ) ) Console . WriteLine ( " Not ▁ possible " ) ; else { int result ; if ( k < Math . Max ( m , n ) - 1 ) { result = Math . Max ( m * ( n / ( k + 1 ) ) , n * ( m / ( k + 1 ) ) ) ; } else { result = Math . Max ( m / ( k - n + 2 ) , n / ( k - m + 2 ) ) ; } Console . WriteLine ( result ) ; } } public static void Main ( ) { int n = 3 , m = 4 , k = 1 ; max_area ( n , m , k ) ; } }