#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct Node {
    int v;
    ll T, K;
    ll t = LLONG_MAX;
    Node(int v, ll T, ll K) : v(v), T(T), K(K) {}
};
struct Data {
    int v;
    ll t = LLONG_MAX;
    Data(int v, ll t) : v(v), t(t) {}
    bool operator < (const Data &d) const {
        return d.t < t;
    }
};
int main() {
    int N, M, X, Y;
    cin >> N >> M >> X >> Y;
    X--;
    Y--;
    int A[M], B[M];
    ll T[M], K[M];
    vector<Node> adj[N];
    for (int i = 0; i < M; i++) {
        cin >> A[i] >> B[i] >> T[i] >> K[i];
        A[i]--;
        B[i]--;
        adj[A[i]].push_back(Node(B[i], T[i], K[i]));
        adj[B[i]].push_back(Node(A[i], T[i], K[i]));
    }
    ll d[N];
    fill(d, d + N, LLONG_MAX);
    d[X] = 0;
    priority_queue<Data> pq;
    pq.push(Data(X, 0));
    bool vis[N] = {};
    while (!pq.empty()) {
        int v = pq.top().v;
        pq.pop();
        if (vis[v]) continue;
        vis[v] = true;
        for (Node i : adj[v]) {
            ll t = i.K * ((d[v] + i.K - 1) / i.K) + i.T;
            if (t < d[i.v]) {
                d[i.v] = t;
                pq.push(Data(i.v, t));
            }
        }
    }
    if (d[Y] == LLONG_MAX) {
        cout << "-1\n";
    } else {
        cout << d[Y] << "\n";
    }
    return 0;
}
#include "bits/stdc++.h"
#define ll long long
#define chl_jldi ios_base::sync_with_stdio(false); cin.tie(0)
#define mnpqll priority_queue<long long, vector<long long>, greater<long long> >
#define mxpqll priority_queue<long long>
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define ff first
#define ss second
#define uset unordered_set
#define pnl cout<<"\n"
#define isodd(xz2) (xz2&1)
#define umap unordered_map
using namespace std;
ll add_mod(ll a,ll b,ll m){return ((((a%m)+(b%m))%m + m)%m);}
ll subs_mod(ll a,ll b,ll m){return ((((a%m)-(b%m))%m + m)%m);}
ll mult_mod(ll a,ll b,ll m){return ((((a%m)*(b%m))%m + m)%m);}
ll power(ll x, ll y){ ll res = 1; while (y > 0) { if (y & 1)res = res * x; y = y >> 1; x = x * x;}return res;}
ll power_mod(ll x, ll y,ll mod){ ll res = 1; while (y > 0) { if (y & 1) res = mult_mod(res, x,mod); y = y >> 1; x = mult_mod(x,x,mod);}return res;}
ll test=1;
const ll mod=1000000007;
void test_case(){             //  cin>>test;
}
//================================================================================================================================================================//

void solve(){
//cout<<"error";

ll a,b,c,d;
cin>>a>>b>>c>>d;

ll red=0;
ll blue=a;
ll ans=0;
while(ans<=(a)){  

    
    if(d*red>=blue) {cout<<ans<<"\n"; return;}
     blue+=b;
    red+=c;
    ans++;
}

cout<<"-1\n";





//cout<<"error";
return;}

int main(){
    chl_jldi;   


#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);
#endif
test_case();    
ll koko=1;
while(koko<=test){
                    //    cout<<"Case #"<<koko<<": ";
solve();    
                    // pnl;

koko++;
}return 0;}
