Given a rectangle of length l and breadth b, we need to find the area of the smallest square which can be formed with the rectangles of these given dimensions.
Input : 1 2 Output : 4 We can form a 2 x 2 square using two rectangles of size 1 x 2. Input : 7 10 Output :4900
Let’s say we want to make a square of side length a from rectangles of length l & b. This means that a is a multiple of both l & b. Since we want the smallest square, it has to be the lowest common multiple (LCM) of l & b.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Number of unique rectangles formed using N unit squares
- Check if N rectangles of equal area can be formed from (4 * N) integers
- Minimum area of square holding two identical rectangles
- Smallest N digit number whose sum of square of digits is a Perfect Square
- Largest square which can be formed using given rectangular blocks
- Smallest multiple of N formed using the given set of digits
- Length of the smallest number which is divisible by K and formed by using 1's only
- Find the area of the shaded region formed by the intersection of four semicircles in a square
- Number formed after K times repeated addition of smallest divisor of N
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array
- Lexicographically smallest array formed by at most one swap for every pair of adjacent indices
- Smallest number whose sum of digits is square of N
- Smallest number whose square has N digits
- Find the Side of the smallest Square that can contain given 4 Big Squares
- Smallest perfect square divisible by all elements of an array
- Find smallest perfect square number A such that N + A is also a perfect square number
- Nth term of a sequence formed by sum of current term with product of its largest and smallest digit
- Check if a number is perfect square without finding square root
- Number of rectangles in N*M grid
- Find all rectangles filled with 0
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.