Number of ways N can be divided into four parts to construct a rectangle | Function to return the required number of ways ; Driver code
function cntWays ( n ) { if ( n % 2 == 1 ) { return 0 ; } else { return ( n - 2 ) / 4 ; } } var n = 18 ; document . write ( cntWays ( n ) ) ;