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 of smaller rectangles that can be placed inside a bigger rectangle
- Largest subset of rectangles such that no rectangle fit in any other rectangle
- Find side of Square which makes minimal area to fit two identical rectangles inside it
- Maximum area of a Rectangle that can be circumscribed about a given Rectangle of size LxW
- Count the number of rhombi possible inside a rectangle of given size
- Intersecting rectangle when bottom-left and top-right corners of two rectangles are given
- Count rectangles generated in a given rectangle by lines drawn parallel to X and Y axis from a given set of points
- Maximum non-attacking Rooks that can be placed on an N*N Chessboard
- Check if all objects of type A and B can be placed on N shelves
- Ratio of area of a rectangle with the rectangle inscribed in it
- Check whether a given point lies inside a rectangle or not
- Coordinates of rectangle with given points lie inside
- Check if a point lies on or inside a rectangle | Set-2
- Check whether a given point lies on or inside the rectangle | Set 3
- Sum of Area of all possible square inside a rectangle
- Generate all integral points lying inside a rectangle
- Largest ellipse that can be inscribed within a rectangle which in turn is inscribed within a semicircle
- Maximum given sized rectangles that can be cut out of a sheet of paper
- Check if N rectangles of equal area can be formed from (4 * N) integers
- Sum of the products of same placed digits of two numbers
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.