#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; map prime_factor(ll x){ map res; for(ll i=2;i*i<=x;i++){ while(x%i==0){ res[i]++; x/=i; } } if(x!=1) res[x]++; return res; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll x,y,a,b; cin>>x>>a>>y>>b; map mx=prime_factor(x),my=prime_factor(y); bool f=true; for(auto t:my){ if(mx[t.first]*a