Given the length L and breadth B of a sheet of paper, the task is to find the maximum number of rectangles with given length l and breadth b that can be cut from this sheet of paper.
Input: L = 5, B = 2, l = 14, b = 3
The sheet is smaller than the required rectangle. So, no rectangle of the given dimension can be cut from the sheet.
Input: L = 10, B = 7, l = 4, b = 3
- Try to cut the rectangles horizontally i.e. length of the rectangle is aligned with the length of the sheet and breadth of the rectangle is aligned with the breadth of the sheet and store the count of rectangles possible in horizontal.
- Repeat the same with vertical alignment i.e. when length of the rectangle is aligned with the breadth of the sheet and breadth of the rectangle is aligned with the length of the sheet and store the result in vertical. Print max(horizontal, vertical) as the result.
Below is the implementation of the above approach:
- Source to destination in 2-D path with fixed sized jumps
- Minimum number of cuts required to make circle segments equal sized
- Find if two rectangles overlap
- Sum of Areas of Rectangles possible for an array
- Find all rectangles filled with 0
- Number of rectangles in N*M grid
- Create a matrix with alternating rectangles of O and X
- Count Distinct Rectangles in N*N Chessboard
- Total area of two overlapping rectangles
- Smallest square formed with given rectangles
- Number of rectangles in a circle of radius R
- Find the minimum number of rectangles left after inserting one into another
- Check if it is possible to rearrange rectangles in a non-ascending order of breadths
- Intersecting rectangle when bottom-left and top-right corners of two rectangles are given
- Count of distinct rectangles inscribed in an equilateral triangle
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.