Given two integers , . Find the number of rectangles of size 2*1 can be placed inside a rectangle of size n*m.
- No two small rectangles overlap.
- Each small rectangle lies entirely inside the large rectangle. It is allowed to touch the edges of the large rectangle.
Input : n = 3, m =3 Output : 4 Input : n = 2, m = 4 Output : 4
- If N is even, then place M rows of N/2 small rectangles and cover the whole large rectangle.
- If M is even, then place N rows of M/2 small rectangles and cover the whole large rectangle.
- If both are odd then cover N – 1 row of the board with small rectangles and put floor(M/2) small rectangles to the last row. In the worst case (N and M are odd) one cell remains uncovered.
Below is the implementation of the above approach:
- Count the number of rhombi possible inside a rectangle of given size
- Maximum area of a Rectangle that can be circumscribed about a given Rectangle of size LxW
- Find side of Square which makes minimal area to fit two identical rectangles inside it
- Largest subset of rectangles such that no rectangle fit in any other rectangle
- Generate a string of size N whose each substring of size M has exactly K distinct characters
- Maximum size of square such that all submatrices of that size have sum less than K
- Intersecting rectangle when bottom-left and top-right corners of two rectangles are given
- Coordinates of rectangle with given points lie inside
- Sum of Area of all possible square inside a rectangle
- Find the minimum number of rectangles left after inserting one into another
- Check if a point lies on or inside a rectangle | Set-2
- Check whether a given point lies inside a rectangle or not
- Check whether a given point lies on or inside the rectangle | Set 3
- Find an array of size N having exactly K subarrays with sum S
- Find the subarray of size K with minimum XOR
- Find a subarray whose sum is divisible by size of the array
- Total number of Subsets of size at most K
- Find array using different XORs of elements in groups of size 4
- Find the count of natural Hexadecimal numbers of size N
- Number of GP (Geometric Progression) subsequences of size 3
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.