#1959: _126


qwer12343 (風中細雨)


#include<iostream>

using namespace std;
int main(){
    int a, b, c, d, x, y;
    while(cin>>a>>b>>c>>d&&a>0 && b>0 && c>0 && d>0){
      x=a*b; y=c*d;
      if(x%y==0)
        cout<<x/y<<endl;
      else
        cout<<-1<<endl;
      }
    return 0;
}