Given an array of pairs containing length and breadth of rectangles. The task is to find the maximum area of the rectangle.
Input: (1, 2), (3, 5), (1, 1), (4, 2) Output: 15 Input: (3, 5), (5, 5), (9, 10) Output: 90
- Use user defined Pair class to store Breadth and Height of rectangles.
- Make an array of this class.
- Now, traverse the array and find the area each time. Also, keep track of maximum area.
- Return the maximum area of rectangle.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Maximum area of rectangle possible with given perimeter
- Maximum area rectangle by picking four sides from array
- Ratio of area of a rectangle with the rectangle inscribed in it
- Java Program for Maximum sum rectangle in a 2D matrix | DP-27
- Program for Area And Perimeter Of Rectangle
- Area of the largest Rectangle without a given point
- Find the percentage change in the area of a Rectangle
- Area of the biggest ellipse inscribed within a rectangle
- Find minimum area of rectangle with given set of coordinates
- Probability of a random pair being the maximum weighted pair
- Pair formation such that maximum pair sum is minimized
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse
- Maximum sum rectangle in a 2D matrix | DP-27
- Maximum area of quadrilateral
- Maximum AND value of a pair in an array
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.