Minimum area of square holding two identical rectangles | C # program for the above problem ; Function to find the area of the square ; Larger side of rectangle ; Smaller side of the rectangle ; Driver code
using System ; class GFG { public static int areaSquare ( int L , int B ) { int large = Math . Max ( L , B ) ; int small = Math . Min ( L , B ) ; if ( large >= 2 * small ) { return large * large ; } else { return ( 2 * small ) * ( 2 * small ) ; } } public static void Main ( ) { int L = 7 ; int B = 4 ; Console . Write ( areaSquare ( L , B ) ) ; } }