text: Minimum number of points required to cover all blocks of a 2 | Function to find the minimum number of Polets required to cover a grid ; If number of block is even ; Return the minimum polets ; Given size of grid ; Function Call
code: function minPolets ( n , m ) { let ans = 0 ; if ( ( n % 2 != 0 ) && ( m % 2 != 0 ) ) { ans = Math . floor ( ( n * m ) / 2 ) + 1 ; } else { ans = Math . floor ( ( n * m ) / 2 ) ; } return ans ; } let N = 5 , M = 7 ; document . write ( minPolets ( N , M ) ) ;