Rectangle with minimum possible difference between the length and the width | Java implementation of the approach ; Function to print the length ( l ) and breadth ( b ) of the rectangle having area = N and | l - b | as minimum as possible ; Driver code
import java . io . * ; class GFG { static void find_rectangle ( int area ) { for ( int i = ( int ) Math . ceil ( Math . sqrt ( area ) ) ; i <= area ; i ++ ) { if ( area / i * i == area ) { System . out . println ( i + " ▁ " + ( int ) ( area / i ) ) ; return ; } } } public static void main ( String [ ] args ) { int area = 99 ; find_rectangle ( area ) ; } }