Maximize GCD of all possible pairs from 1 to N | C ++ 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; void find ( int n ) { cout << n / 2 << endl ; } int main ( ) { int n = 5 ; find ( n ) ; return 0 ; }