#include using namespace std; using ll = long long; using vi = vector; using vvi = vector; using vvvi = vector; using vll = vector; using vvll = vector; using vvvll = vector; using vs = vector; using pll = pair; using vp = vector; #define rep(i, n) for(ll i = 0; i < (n); i++) #define repr(i, a, b) for(ll i = (a); i < (b); i++) #define ALL(a) (a).begin(), (a).end() #define SZ(x) ((ll)(x).size()) const ll MOD = 1000000007; const ll INF = 100000000000000000LL; inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; } inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; } inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; } inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; } templatebool chmax(T &a, const T &b){ if(abool chmin(T &a, const T &b){ if(b> a >> b; vll div = divisor(a+b); for(auto&& c: div){ if((b+c)%a == 0 && (c+a)%b == 0 && b != c && c != a){ cout << c << endl; return 0; } } cout << -1 << endl; return 0; }