/// G. Hagopian working on Euclidean algorithm

#include "std_lib_facilities.h"

//------------------------------------------------------------------------------
/*
    Brute Force
*/

int tryDivisor(int m, int n, int g) {
    if (((m % g) == 0) && ((n % g) == 0))  /// base case
        return g;
    else {
        cout << "\ng = " << g;
        return tryDivisor(m, n, g - 1);
    }
}

int main()
{
    int m{1}, n{1};
    cout << "\nEnter two numbers, m < n, to get the GCD: ";
    while(cin >> m >> n) {
        cout << tryDivisor(m,n,m);
        cout << "\nEnter two numbers, m < n, to get the GCD: ";
    }
}

//------------------------------------------------------------------------------

