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
< ? php function max_area ( $ n , $ m , $ k ) { if ( $ k > ( $ n + $ m - 2 ) ) echo " Not ▁ possible " , " STRNEWLINE " ; else { $ 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 ) ) ; } echo $ result , " STRNEWLINE " ; } } $ n = 3 ; $ m = 4 ; $ k = 1 ; max_area ( $ n , $ m , $ k ) ; ? >