Maximize GCD of all possible pairs from 1 to N | Java Program to implement the approach ; Function to obtain the maximum gcd of all pairs from 1 to n ; Print the answer ; Driver code ; Function call
class GFG { static void find ( int n ) { System . out . println ( n / 2 ) ; } public static void main ( String [ ] args ) { int n = 5 ; find ( n ) ; } }