#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
using namespace std;
typedef pair<ll,ll> pll;

typedef pair<ll ,pll> ed;
ll n;
vector< ed > g[100005];
ll q;
const ll N = 1e5 + 5;
ll x[N], y[N] , u[N], v[N];
ll par[N][22];
ll col[N];
ll D[N];
ll colcnt[N];
ll dep[N];
map<ll,ll>mp[N][2];
void dfs(ll s, ll pr)
{
        par[s][0] = pr;
        dep[s] = dep[pr] + 1;
        for(ll i=1;i<=20;i++) {
                par[s][i] = par[par[s][i-1]][i-1];
        }
        for(auto &i : g[s]) {
                if(i.first == pr) continue;
                dfs(i.first, s);
        }
}
vector< ll > asks[N][2];
ll walks(ll s, ll dis)
{
        for(ll i=20;i>=0;i--){
                if((dis&(1LL << i))){
                        s = par[s][i];
                }
        }
        return s;
}
ll getlca(ll p, ll q)
{
        if(p==q) return p;
        if(dep[p] > dep[q]) swap(p, q);
        q = walks(q, dep[q] - dep[p]);
        if(p==q) return p;
        for(ll i=20;i>=0;i--){
                ll pp = walks(p, 1LL << i);
                ll qq = walks(q, 1LL << i);
                if(pp != qq) {
                        p = pp;
                        q = qq;
                }
        }
        assert(par[p][0] == par[q][0]);
        return par[p][0];
}
void dfs2(ll s, ll pr)
{
        //cout << s << " ***** " << endl;
        for(auto &i : asks[s][0]){
                mp[s][0][i] = col[i];
                //cout << i << " .... " << col[i] << endl;
        }
        for(auto &i : asks[s][1]) {
                mp[s][1][i] = colcnt[i];
                //cout << i << " ---- " << colcnt[i] << endl;
        }
        for(auto &i : g[s]) {
                if(i.first == pr) continue;
                D[i.first] = D[s] + i.second.second;
                col[i.second.first] += i.second.second;
                colcnt[i.second.first]++;
                dfs2(i.first , s);
                col[i.second.first] -= i.second.second;
                colcnt[i.second.first]--;
        }
}
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL); cout.tie(NULL);
        cin >> n >> q;
        for(ll i=1;i<n;i++) {
                ll A,B,C,D;
                cin >> A >> B >> C >> D;
                g[A].pb(make_pair(B, make_pair(C,D)));
                g[B].pb(make_pair(A, make_pair(C, D)));
        }
        dep[0] = 0;
        dfs(1, 0);
        for(ll i=1;i<=q;i++) {
                cin >> x[i] >> y[i] >> u[i] >> v[i];

                ll LCA = getlca(u[i], v[i]);
                //cout << u[i] << " ------ " << v[i] << " " << LCA << endl;
                asks[LCA][0].pb(x[i]);
                asks[u[i]][0].pb(x[i]);
                asks[v[i]][0].pb(x[i]);

                asks[LCA][1].pb(x[i]);
                asks[u[i]][1].pb(x[i]);
                asks[v[i]][1].pb(x[i]);
        }
        dfs2(1,-1);

        for(ll i=1;i<=q;i++) {
                ll L = getlca(u[i], v[i]);
                ll ans = D[u[i]] + D[v[i]] - 2*D[L];
                ans -= (mp[u[i]][0][x[i]] + mp[v[i]][0][x[i]] - 2*mp[L][0][x[i]]);
                ans += (  (mp[u[i]][1][x[i]] + mp[v[i]][1][x[i]] - 2*mp[L][1][x[i]])*y[i] );
                cout << ans << "\n";
        }
        return 0;
}


Measured memory_bytes: 87860