Number of largest circles that can be inscribed in a rectangle | Java program for the above approach ; Function to count the number of largest circles in a rectangle ; If length exceeds breadth ; Swap to reduce length to smaller than breadth ; Return total count of circles inscribed ; Driver Code
import java . io . * ; import java . util . * ; class GFG { static int totalCircles ( int L , int B ) { if ( L > B ) { int temp = L ; L = B ; B = temp ; } return B / L ; } public static void main ( String [ ] args ) { int L = 3 ; int B = 8 ; System . out . print ( totalCircles ( L , B ) ) ; } }