#include <bits/stdc++.h>

using namespace std;

#define MAX 100005

typedef pair<int, pair<int, int>> pip;
typedef pair<pair<int, int>, pip> ppp;
typedef long long ll;

vector<pip> adj[MAX];
vector<ppp> queries;
vector<ll> dst(MAX, 0);
map<int, int> mct[MAX], mcdt[MAX];
vector<int> req[MAX], ct(MAX, 0), cdt(MAX, 0), intime(MAX), outime(MAX);
vector<vector<int>> dp(MAX, vector<int>(20, 0));
int tmm = 0;

void get(int v, int p){
    dp[v][0] = p;
    intime[v] = tmm++;
    for(auto u : adj[v])
        if( u.first != p )
            get(u.first, v);
    outime[v] = tmm++;
}

bool isAncestor(int u, int v){
    return intime[u] < intime[v] && outime[u] > outime[v];
}

int lca(int u, int v){
    if( isAncestor(u, v) )
        return u;
    if( isAncestor(v, u) )
        return v;
    for(int i = 19; i >= 0; i--)
        if( ! isAncestor(dp[u][i], v) )
            u = dp[u][i];
    return dp[u][0];
}

void dfs(int v, int p){
    for(auto u : adj[v]){
        if( u.first != p ){
            dst[u.first] = dst[v] + u.second.second;
            ct[u.second.first]++;
            cdt[u.second.first] += u.second.second;
            for(auto e : req[u.first]){
                mct[u.first][e] = ct[e];
                mcdt[u.first][e] = cdt[e];
            }
            dfs(u.first, v);
            ct[u.second.first]--;
            cdt[u.second.first] -= u.second.second;
        }
    }
}

int main(){

    int n, q;
    cin >> n >> q;
    int a, b, c, d;
    for(int i = 0; i < n-1; i++){
        cin >> a >> b >> c >> d;
        a--, b--;
        adj[a].push_back(make_pair(b, make_pair(c, d)));
        adj[b].push_back(make_pair(a, make_pair(c, d)));
    }

    get(0, 0);
    for(int i = 1; i < 20; i++)
        for(int j = 0; j < n; j++)
            dp[j][i] = dp[dp[j][i-1]][i-1];

    int x, y, u, v, lc;
    for(int i = 0; i < q; i++){
        cin >> x >> y >> u >> v;
        u--, v--;
        lc = lca(u, v);
        req[u].push_back(x);
        req[v].push_back(x);
        req[lc].push_back(x);
        queries.push_back(make_pair(make_pair(x, y), make_pair(lc, make_pair(u, v))));
    }

    dfs(0, 0);

    for(auto q : queries){
        u = q.second.second.first, v = q.second.second.second, lc = q.second.first;
        x = q.first.first, y = q.first.second;
        ll dd = dst[u] + dst[v] - 2*dst[lc];
        ll cld = mcdt[u][x] + mcdt[v][x] - 2*mcdt[lc][x];
        ll ccn = mct[u][x] + mct[v][x] - 2*mct[lc][x];
        cout << ( dd - cld + y*ccn) << endl;
    }
    return 0;
}