#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007;
const int MAX_N = 1<<18;
int used[100001];
int u=0;

vector<pair<int,pair<int,int>>> hen[100001],iro[100001];
int N,man[100001]={};
pair<int,int> dat[2*MAX_N -1];
void init(int m){
    N=1;
    while(N<m)N*=2;
    for(int i=0;i<2*N-1;i++)dat[i]=make_pair(LLONG_MAX,LLONG_MAX);
}
void update(int k,pair<int,int> a){
    k+=N-1;
    dat[k]=a;
    while(k>0){
        k=(k-1)/2;
        dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
}

pair<int,int> query(int a,int b,int k,int l,int r){
    if(r<=a||b<=l)return make_pair(LLONG_MAX,LLONG_MAX);
    if(a<=l&&r<=b)return dat[k];
    return min(query(a,b,k*2+1,l,(l+r)/2),query(a,b,k*2+2,(l+r)/2,r));
}
void dfs(int a,int c,int kane){
    used[a]=u;
    man[a]=kane;
    update(u,make_pair(c,a));
    u++;
    for(int i=0;i<hen[a].size();i++){
        if(used[hen[a][i].first]==-1){
           iro[hen[a][i].second.first].push_back(make_pair(u,make_pair(iro[hen[a][i].second.first][iro[hen[a][i].second.first].size()-1].second.first+1,iro[hen[a][i].second.first][iro[hen[a][i].second.first].size()-1].second.second+hen[a][i].second.second)));
            dfs(hen[a][i].first,c+1ll,kane+hen[a][i].second.second);
            iro[hen[a][i].second.first].push_back(make_pair(u,make_pair(iro[hen[a][i].second.first][iro[hen[a][i].second.first].size()-1].second.first-1,iro[hen[a][i].second.first][iro[hen[a][i].second.first].size()-1].second.second-hen[a][i].second.second)));
             update(u,make_pair(c,a));
            u++;
        }
    }
   
}

signed main() {
    int n,q;
    cin>>n>>q;
    fill(used,used+n,-1ll);
    int a,b,c,d;
    for(int i=0;i<n-1;i++){
        cin>>a>>b>>c>>d;
        hen[a-1].push_back(make_pair(b-1,make_pair(c-1,d)));
         hen[b-1].push_back(make_pair(a-1,make_pair(c-1,d)));
    }
    init(2*n);
    for(int i=0;i<n;i++)iro[i].push_back(make_pair(0ll,make_pair(0ll,0ll)));

    dfs(0,0,0);
    
    int x,y,v,w,ok,ng,mid,ans;
    for(int i=0;i<q;i++){
        cin>>x>>y>>u>>v;x--;u--;v--;
        if(used[u]>used[v])swap(u,v);
        w=(query(used[u],used[v]+1,0,0,N)).second;
        ok=0;ng=iro[x].size();ans=0;
   
        while(abs(ok-ng)>1){
            mid=(ok+ng)/2;
            if(used[u]>=iro[x][mid].first)ok=mid;
            else ng=mid;
        }
        ans+=man[u]+iro[x][ok].second.first*y-iro[x][ok].second.second;
       // cerr<<ans<<' '<<used[u]<<' '<<ok<<' '<<iro[x][ok].second.second<<endl;
        ok=0;ng=iro[x].size();
        while(abs(ok-ng)>1){
            mid=(ok+ng)/2;
            if(used[v]>=iro[x][mid].first){
                ok=mid;
               
               // cerr<<' '<<iro[x][mid].first<<endl;
            }
            else ng=mid;
        }
        // for(int i=0;i<iro[x].size();i++)cerr<<iro[x][i].first<<' ';
        ans+=man[v]+iro[x][ok].second.first*y-iro[x][ok].second.second;
     //  cerr<<ans<<' '<<used[v]<<' '<<ok<<' '<<iro[x][ok].second.second<<endl;
        ok=0;ng=iro[x].size();
        while(abs(ok-ng)>1){
            mid=(ok+ng)/2;
            if(used[w]>=iro[x][mid].first)ok=mid;
            else ng=mid;
        }
         // cerr<<w<<' '<<man[w]<<' '<<ok<<' '<<iro[x][ok].second.second<<endl;
        ans-=2*(man[w]+iro[x][ok].second.first*y-iro[x][ok].second.second);
        cout<<ans<<endl;
    }
return 0;
}


Measured memory_bytes: 41392