Find the number of rectangles of size 2 * 1 which can be placed inside a rectangle of size n * m | function to Find the number of rectangles of size 2 * 1 can be placed inside a rectangle of size n * m ; if n is even ; if m is even ; if both are odd ; Driver code ; function call
< ? php function NumberOfRectangles ( $ n , $ m ) { if ( $ n % 2 == 0 ) return ( $ n / 2 ) * $ m ; else if ( $ m % 2 == 0 ) return ( $ m / 2 ) * $ n ; return ( $ n * $ m - 1 ) / 2 ; } $ n = 3 ; $ m = 3 ; echo NumberOfRectangles ( $ n , $ m ) ; ? >