#include using namespace std; #include using namespace atcoder; using ll = long long; ll n,m; void solve(){ ll g = gcd(n,m); n/=g; m/=g; ll M = m; int t = 0,f = 0; while(M%5==0)M/=5,f++; while(M%2==0)M/=2,t++; if(M!=1){ cout<<-1<> n >> m; solve(); }