For this Question: You are amazed at the relationship between John and Olivia. So you decided to tell that how many different pairs of relationships can be made from John and Olivia's relationship. For that, there is an array of length N and you need to divide it into K components such that each component contains an equal number of elements, no element is in two different components, and together it contains all the elements. You also need to divide in such a way that the parity of the sum of all the components is the same.
If there exists more than one K. Output the maximum such K.

But the array itself is not given only the number of odd, the number of even elements is given.The only line contains two integers A, B such that A denotes the number of even elements in the array and B denotes the number of odd elements in the array.

<b>Constraints</b>
1 <= A <= 10<sup>10</sup>
1 <= B <= 10<sup>10</sup>Output a single integer K the maximum value of the number of the components.Sample Input 1:
5 4

Sample Output 1:
3, I have written this Solution Code: //HEADER FILES AND NAMESPACES
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp>  
#pragma GCC target("popcnt") 
using namespace std;
using namespace __gnu_pbds;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; 

using cd = complex<double>;
const double PI = acos(-1);
// DEFINE STATEMENTS
const long long infty = 1e18;
#define num1 1000000007
#define num2 998244353
#define REP(i,a,n) for(ll i=a;i<n;i++)
#define REPd(i,a,n) for(ll i=a; i>=n; i--)
#define pb push_back
#define pob pop_back
#define fr first
#define sc second
#define fix(f,n) std::fixed<<std::setprecision(n)<<f
#define all(x) x.begin(), x.end()
#define M_PI 3.14159265358979323846
#define epsilon (double)(0.000000001)
#define popcount __builtin_popcountll
#define fileio(x) freopen("input.txt", "r", stdin); freopen(x, "w", stdout);
#define out(x) cout << ((x) ? "Yes\n" : "No\n")
#define sz(x) x.size()
 
 
typedef long long ll;
typedef long long unsigned int llu;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;
typedef vector<pair<long long, long long>> vpll;
typedef vector<int> vii;
 
// DEBUG FUNCTIONS 
#ifndef ONLINE_JUDGE
 
template<typename T>
void __p(T a) {
    cout<<a;
}
template<typename T, typename F>
void __p(pair<T, F> a) {
    cout<<"{";
    __p(a.first);
    cout<<",";
    __p(a.second);
    cout<<"}";
}
template<typename T>
void __p(std::vector<T> a) {
    cout<<"{";
    for(auto it=a.begin(); it<a.end(); it++)
        __p(*it),cout<<",}"[it+1==a.end()];
}
template<typename T>
void __p(std::set<T> a) {
    cout<<"{";
    for(auto it=a.begin(); it!=a.end();){
        __p(*it); 
        cout<<",}"[++it==a.end()];
    }
 
}
template<typename T>
void __p(std::multiset<T> a) {
    cout<<"{";
    for(auto it=a.begin(); it!=a.end();){
        __p(*it); 
        cout<<",}"[++it==a.end()];
    }
}
template<typename T, typename F>
void __p(std::map<T,F> a) {
    cout<<"{\n";
    for(auto it=a.begin(); it!=a.end();++it)
    {
        __p(it->first);
        cout << ": ";
        __p(it->second);
        cout<<"\n";
    }
    cout << "}\n";
}
 
template<typename T, typename ...Arg>
void __p(T a1, Arg ...a) {
    __p(a1);
    __p(a...);
}
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
    cout<<name<<" : ";
    __p(arg1);
    cout<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
    int bracket=0,i=0;
    for(;; i++)
        if(names[i]==','&&bracket==0)
            break;
        else if(names[i]=='(')
            bracket++;
        else if(names[i]==')')
            bracket--;
    const char *comma=names+i;
    cout.write(names,comma-names)<<" : ";
    __p(arg1);
    cout<<" | ";
    __f(comma+1,args...);
}
#define trace(...) cout<<"Line:"<<__LINE__<<" ", __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...)
#define error(...)
#endif
 

void solve(){
    ll e, o; cin >> e >> o;
    ll n = e+o;
    ll ans = 1;
    // a - even, b - odd
    for(ll i = 1;i*i<=n;i++){
        if(n%i != 0)continue;
        ll x = i;
        if(o%2 == 0){
            // all x components is even
            ll temp1 = 1;
            if(2*x*((n/x)/2) < o)temp1 = 0;
            // all x components is odd
            ll temp2 = 1;
            if(x%2 == 1)temp2 = 0;
            if(x > o)temp2 = 0;
            if(2*x*((n/x - 1)/2) < o - x)temp2 = 0;
            if(temp1||temp2)ans = max(ans,x);
        }
        else{
            // all x components is odd
            ll temp = 1;
            if(x%2 == 0)temp = 0;
            if(x>o)temp = 0;
            if(2*x*((n/x-1)/2) < o-x)temp = 0;
            if(temp)ans = max(ans,x);
        }


        x = n/i;
        if(o%2 == 0){
            // all x components is even
            ll temp1 = 1;
            if(2*x*((n/x)/2) < o)temp1 = 0;
            // all x components is odd
            ll temp2 = 1;
            if(x%2 == 1)temp2 = 0;
            if(x > o)temp2 = 0;
            if(2*x*((n/x - 1)/2) < o - x)temp2 = 0;
            if(temp1||temp2)ans = max(ans,x);
        }
        else{
            // all x components is odd
            ll temp = 1;
            if(x%2 == 0)temp = 0;
            if(x>o)temp = 0;
            if(2*x*((n/x-1)/2) < o-x)temp = 0;
            if(temp)ans = max(ans,x);
        }


        
    }
    cout << ans << "\n";

}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // cout.tie(NULL);
 
    #ifdef LOCALFLAG 
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ll t = 1;
    // cin >> t;
    while(t--){
        solve();
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?