Count tiles of dimensions 2 * 1 that can be placed in an M * N rectangular board that satisfies the given conditions | C # Program to implement the above approach ; Function to tiles of size 2 x 1 find the number of tiles that can be placed as per the given conditions ; Number of tiles required ; Driver Code
using System ; public class GFG { static int numberOfTiles ( int n , int m ) { if ( n % 2 == 1 ) { return - 1 ; } return ( m * n ) / 2 ; } static public void Main ( ) { int n = 2 , m = 4 ; Console . WriteLine ( numberOfTiles ( n , m ) ) ; } }