#include<bits/stdc++.h>
using namespace std;
void *wmem;
template<class S, class T> inline S min_L(S a,T b){
  return a<=b?a:b;
}
template<class S, class T> inline S max_L(S a,T b){
  return a>=b?a:b;
}
template<class T1, class T2> void sortA_L(int N, T1 a[], T2 b[], void *mem = wmem){
  int i;
  pair<T1, T2> *arr=(pair<T1, T2> *) mem;
  for(i=0;i<N;i++){
    arr[i].first = a[i];
    arr[i].second = b[i];
  }
  sort(arr, arr+N);
  for(i=0;i<N;i++){
    a[i] = arr[i].first;
    b[i] = arr[i].second;
  }
}
template<class T1, class T2, class T3, class T4> void sortA_L(int N, T1 a[], T2 b[], T3 c[], T4 d[], void *mem = wmem){
  int i;
  pair<pair<T1, T2>, pair<T3, T4> > *arr=(pair<pair<T1, T2>, pair<T3, T4> > *) mem;
  for(i=0;i<N;i++){
    arr[i].first.first = a[i];
    arr[i].first.second = b[i];
    arr[i].second.first = c[i];
    arr[i].second.second = d[i];
  }
  sort(arr, arr+N);
  for(i=0;i<N;i++){
    a[i] = arr[i].first.first;
    b[i] = arr[i].first.second;
    c[i] = arr[i].second.first;
    d[i] = arr[i].second.second;
  }
}
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  char f[20];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class T> struct fenwick{
  T *data;
  int memory, size;
  void malloc(int mem){
    memory = mem;
    data = (T*)std::malloc(sizeof(T)*mem);
  }
  void walloc(int mem, void **workMemory=&wmem){
    memory = mem;
    data = (T*)(*workMemory);
    *workMemory = data + mem;
  }
  void free(void){
    memory = 0;
    free(data);
  }
  void init(int N){
    size = N;
    memset(data,0,sizeof(T)*N);
  }
  void add(int k, T val){
    while(k < size){
      data[k] += val;
      k |= k+1;
    }
  }
  T get(int k){
    T res=0;
    while(k>=0){
      res += data[k];
      k = (k&(k+1))-1;
    }
    return res;
  }
  T range(int a, int b){
    if(b==-1){
      b=size-1;
    }
    return get(b) - get(a-1);
  }
  int kth(T k){
    T v;
    int c, i=0, j=size;
    while(i<j){
      c = (i+j)/2;
      v = get(c);
      if(v <= k){
        i=c+1;
      }
      else{
        j=c;
      }
    }
    return i==size?-1:i;
  }
}
;
struct graph{
  int N, **edge, *es;
  void setEdge(int N__, int M, int A[], int B[], void **mem = &wmem){
    int i;
    N = N__;
    es = (int*)(*mem);
    edge = (int**)(es+N);
    edge[0] = (int*)(edge+N);
    for(i=0;i<N;i++){
      es[i] = 0;
    }
    for(i=0;i<M;i++){
      es[A[i]]++;
      es[B[i]]++;
    }
    for(i=1;i<N;i++){
      edge[i] = edge[i-1] + es[i-1];
    }
    (*mem) = edge[N-1] + es[N-1];
    for(i=0;i<N;i++){
      es[i] = 0;
    }
    for(i=0;i<M;i++){
      edge[A[i]][es[A[i]]++] = B[i];
      edge[B[i]][es[B[i]]++] = A[i];
    }
  }
  void setDirectEdge(int N__, int M, int A[], int B[], void **mem = &wmem){
    int i;
    N = N__;
    es = (int*)(*mem);
    edge = (int**)(es+N);
    edge[0] = (int*)(edge+N);
    for(i=0;i<N;i++){
      es[i] = 0;
    }
    for(i=0;i<M;i++){
      es[A[i]]++;
    }
    for(i=1;i<N;i++){
      edge[i] = edge[i-1] + es[i-1];
    }
    (*mem) = edge[N-1] + es[N-1];
    for(i=0;i<N;i++){
      es[i] = 0;
    }
    for(i=0;i<M;i++){
      edge[A[i]][es[A[i]]++] = B[i];
    }
  }
  graph reverse(void **mem = &wmem){
    graph g;
    int i, j, k;
    g.N = N;
    g.es = (int*)(*mem);
    g.edge = (int**)(g.es + N);
    g.edge[0] = (int*)(g.edge + N);
    for(i=0;i<N;i++){
      g.es[i] = 0;
    }
    for(i=0;i<N;i++){
      for(j=0;j<es[i];j++){
        g.es[edge[i][j]]++;
      }
    }
    for(i=1;i<N;i++){
      g.edge[i] = g.edge[i-1] + g.es[i-1];
    }
    *mem = g.edge[N-1] + g.es[N-1];
    for(i=0;i<N;i++){
      g.es[i] = 0;
    }
    for(i=0;i<N;i++){
      for(j=0;j<es[i];j++){
        k = edge[i][j];
        g.edge[k][g.es[k]++] = i;
      }
    }
    return g;
  }
  graph reduce(int tn, int ind[], int self_e = 0, int dep_e = 0, void **mem = &wmem){
    graph g;
    int M=0, i, j, k, x, y;
    pair<int,int> *A;
    for(i=0;i<N;i++){
      M += es[i];
    }
    A = (pair<int,int>*)((int*)((int**)(*mem) + tn) + tn + M);
    M = 0;
    for(i=0;i<N;i++){
      x = ind[i];
      if(x < 0){
        continue;
      }
      for(j=0;j<es[i];j++){
        y = ind[edge[i][j]];
        if(y < 0){
          continue;
        }
        if(self_e==0 && x==y){
          continue;
        }
        A[M++] = make_pair(x, y);
      }
    }
    if(dep_e==0){
      sort(A, A+M);
      k = 0;
      for(i=0;i<M;i++){
        if(k && A[k-1]==A[i]){
          continue;
        }
        A[k++] = A[i];
      }
      M = k;
    }
    g.N = tn;
    g.es = (int*)(*mem);
    g.edge = (int**)(g.es + tn);
    g.edge[0] = (int*)(g.edge + tn);
    for(i=0;i<tn;i++){
      g.es[i] = 0;
    }
    for(i=0;i<M;i++){
      g.es[A[i].first]++;
    }
    for(i=1;i<tn;i++){
      g.edge[i] = g.edge[i-1] + g.es[i-1];
    }
    *mem = g.edge[tn-1] + g.es[tn-1];
    for(i=0;i<tn;i++){
      g.es[i] = 0;
    }
    for(i=0;i<M;i++){
      j = A[i].first;
      k = A[i].second;
      g.edge[j][g.es[j]++] = k;
    }
    return g;
  }
  void getDist(int root, int res[], void *mem = wmem){
    int i, j, k, *q, s, z;
    q=(int*)mem;
    for(i=0;i<N;i++){
      res[i]=-1;
    }
    res[root]=0;
    s=0;
    z=1;
    q[0]=root;
    while(z){
      i=q[s++];
      z--;
      for(j=0;j<es[i];j++){
        k=edge[i][j];
        if(res[k]>=0){
          continue;
        }
        res[k]=res[i]+1;
        q[s+z++]=k;
      }
    }
  }
  inline int sccDFS(int num[], int st, int mx){
    int i, j;
    num[st]=-2;
    for(i=0;i<es[st];i++){
      j=edge[st][i];
      if(num[j]==-1){
        mx=sccDFS(num,j,mx);
      }
    }
    num[st]=mx;
    return mx+1;
  }
  int scc(int res[], void *mem = wmem){
    graph r;
    int i, j, k, *nrv, *num, ret=0, *st, st_size;
    r = reverse(&mem);
    st = (int*)mem;
    num = st+N;
    nrv = num + N;
    for(i=0;i<N;i++){
      res[i] = num[i] = -1;
    }
    k = 0;
    for(i=0;i<N;i++){
      if(num[i]==-1){
        k = sccDFS(num,i,k);
      }
    }
    for(i=0;i<N;i++){
      nrv[num[i]] = i;
    }
    for(k=N-1;k>=0;k--){
      i=nrv[k];
      if(res[i]>=0){
        continue;
      }
      res[i]=ret;
      st_size=0;
      st[st_size++]=i;
      while(st_size){
        i=st[--st_size];
        for(j=0;j<r.es[i];j++){
          if(res[r.edge[i][j]]==-1){
            res[r.edge[i][j]]=ret;
            st[st_size++]=r.edge[i][j];
          }
        }
      }
      ret++;
    }
    return ret;
  }
  inline void bccDFS(int v, int u, int *res, int *rt, int &rts, int *S, int &Ss, int *inS, int *num, int &tm){
    int i, k;
    num[v] = ++tm;
    S[Ss++] = v;
    inS[v] = 1;
    rt[rts++] = v;
    for(i=0;i<es[v];i++){
      int w=edge[v][i];
      if(!num[w]){
        bccDFS(w, v, res, rt, rts, S, Ss, inS, num, tm);
      }
      else if(u != w && inS[w]){
        while(num[rt[rts-1]] > num[w]){
          rts--;
        }
      }
    }
    if(v == rt[rts-1]){
      k = S[Ss-1];
      for(;;){
        int w=S[--Ss];
        inS[w] = 0;
        res[w] = k;
        if(v==w){
          break;
        }
      }
      rts--;
    }
  }
  int bcc(int res[], void *mem=wmem){
    int *S, Ss=0, i, *inS, k, *num, *rt, rts=0, tm=0;
    pair<int,int> *arr;
    num = (int*)mem;
    rt = num + N;
    S = rt + N;
    inS = S + N;
    memset(num, 0, sizeof(int)*N);
    memset(inS, 0, sizeof(int)*N);
    for(i=0;i<N;i++){
      if(!num[i]){
        bccDFS(i, N, res, rt, rts, S, Ss, inS, num, tm);
      }
    }
    arr = (pair<int,int>*)mem;
    for(i=0;i<N;i++){
      arr[i].first = res[i];
      arr[i].second = i;
    }
    sort(arr, arr+N);
    k = 0;
    for(i=0;i<N;i++){
      if(i && arr[i].first != arr[i-1].first){
        k++;
      }
      res[arr[i].second] = k;
    }
    return k+1;
  }
  int shortestPath(const int s, const int t, int res[], void *mem=wmem){
    int *b, i, j, k, *q, qe=0, qs=0;
    b = (int*)mem;
    q = b + N;
    for(i=0;i<N;i++){
      b[i] = -1;
    }
    b[s] = -2;
    q[qe++] = s;
    while(qe > qs){
      i = q[qs++];
      for(j=0;j<es[i];j++){
        k = edge[i][j];
        if(b[k]!=-1){
          continue;
        }
        b[k] = i;
        q[qe++] = k;
      }
      if(b[t]!=-1){
        break;
      }
    }
    if(b[t]==-1){
      return -1;
    }
    k = 0;
    res[k] = i = t;
    while(i != s){
      res[++k] = (i = b[i]);
    }
    std::reverse(res, res+k+1);
    return k;
  }
}
;
struct HLD{
  int N, **edge, *es, *group, *groupDepth, **groupNode, groupNum, *groupSize, *groupUpNode, *groupind;
  void init(graph g, void **mem = &wmem){
    init(g.N, g.es, g.edge, mem);
  }
  void init(int N__, int *es__, int **edge__, void **mem = &wmem){
    char *vis;
    int i, j, k, mx, *q, q_ed, q_st, *sz, x, y;
    N = N__;
    es = es__;
    edge = edge__;
    group = (int*)(*mem);
    groupind = group + N;
    *mem = groupind + N;
    q = (int*)(*mem);
    sz = q + N;
    vis = (char*)(sz + N);
    for(i=0;i<N;i++){
      vis[i] = 0;
    }
    q_st = 0;
    q_ed = 1;
    q[0] = 0;
    vis[0] = 1;
    while(q_st < q_ed){
      i = q[q_st++];
      for(j=0;j<es[i];j++){
        k = edge[i][j];
        if(!vis[k]){
          vis[k] = 1;
          q[q_ed++] = k;
        }
      }
    }
    for(i=0;i<N;i++){
      sz[i] = 0;
    }
    for(j=N-1;j>=0;j--){
      i = q[j];
      sz[i] = 1;
      for(k=0;k<es[i];k++){
        sz[i] += sz[edge[i][k]];
      }
    }
    for(i=0;i<N;i++){
      group[i] = -1;
    }
    groupNum = 0;
    for(j=0;j<N;j++){
      i = q[j];
      if(group[i]>=0){
        continue;
      }
      group[i] = groupNum++;
      groupind[i] = 0;
      for(;;){
        mx = -1;
        for(k=0;k<es[i];k++){
          if(group[edge[i][k]] != -1){
            continue;
          }
          if(mx==-1){
            mx = k;
          }
          else if(sz[edge[i][k]] > sz[edge[i][mx]]){
            mx = k;
          }
        }
        if(mx==-1){
          break;
        }
        group[edge[i][mx]] = group[i];
        groupind[edge[i][mx]] = groupind[i]+1;
        i = edge[i][mx];
      }
    }
    groupSize = (int*)(*mem);
    groupUpNode = groupSize + groupNum;
    groupDepth = groupUpNode + groupNum;
    for(i=0;i<groupNum;i++){
      groupSize[i] = 0;
    }
    for(i=0;i<N;i++){
      groupSize[group[i]]++;
    }
    groupNode = (int**)(groupDepth + groupNum);
    groupNode[0] = (int*)(groupNode + groupNum);
    for(i=1;i<groupNum;i++){
      groupNode[i] = groupNode[i-1] + groupSize[i-1];
    }
    *mem = groupNode[groupNum-1] + groupSize[groupNum-1];
    for(i=0;i<N;i++){
      groupNode[group[i]][groupind[i]] = i;
    }
    for(i=0;i<groupNum;i++){
      groupDepth[i] = -1;
    }
    groupUpNode[0] = -1;
    groupDepth[0] = 0;
    for(x=0;x<groupNum;x++){
      for(y=0;y<groupSize[x];y++){
        i = groupNode[x][y];
        for(j=0;j<es[i];j++){
          k = edge[i][j];
          if(x != group[k] && groupDepth[group[k]]==-1){
            groupUpNode[group[k]] = i;
            groupDepth[group[k]] = groupDepth[x] + 1;
          }
        }
      }
    }
  }
  int lca(int x, int y){
    int x1, x2, y1, y2;
    x1 = group[x];
    x2 = groupind[x];
    y1 = group[y];
    y2 = groupind[y];
    while(groupDepth[x1] > groupDepth[y1]){
      x = groupUpNode[x1];
      x1 = group[x];
      x2 = groupind[x];
    }
    while(groupDepth[x1] < groupDepth[y1]){
      y = groupUpNode[y1];
      y1 = group[y];
      y2 = groupind[y];
    }
    while(x1 != y1){
      x = groupUpNode[x1];
      x1 = group[x];
      x2 = groupind[x];
      y = groupUpNode[y1];
      y1 = group[y];
      y2 = groupind[y];
    }
    if(x2 <= y2){
      return x;
    }
    return y;
  }
  int depth(int x){
    int res=0, x1, x2;
    x1 = group[x];
    x2 = groupind[x];
    while(groupUpNode[x1] != -1){
      res += x2 + 1;
      x = groupUpNode[x1];
      x1 = group[x];
      x2 = groupind[x];
    }
    return res + x2;
  }
  int dist(int x, int y){
    int res=0, x1, x2, y1, y2;
    x1 = group[x];
    x2 = groupind[x];
    y1 = group[y];
    y2 = groupind[y];
    while(groupDepth[x1] > groupDepth[y1]){
      res += x2 + 1;
      x = groupUpNode[x1];
      x1 = group[x];
      x2 = groupind[x];
    }
    while(groupDepth[x1] < groupDepth[y1]){
      res += y2 + 1;
      y = groupUpNode[y1];
      y1 = group[y];
      y2 = groupind[y];
    }
    while(x1 != y1){
      res += x2 + y2 + 2;
      x = groupUpNode[x1];
      x1 = group[x];
      x2 = groupind[x];
      y = groupUpNode[y1];
      y1 = group[y];
      y2 = groupind[y];
    }
    if(x2 <= y2){
      return res + y2 - x2;
    }
    return res + x2 - y2;
  }
  int up(int x){
    int x1=group[x], x2=groupind[x];
    if(x2==0){
      return groupUpNode[x1];
    }
    return groupNode[x1][x2-1];
  }
  int up(int x, int d){
    int x1=group[x], x2=groupind[x];
    while(d > x2){
      if(groupUpNode[x1]==-1){
        return -1;
      }
      d -= x2 + 1;
      x = groupUpNode[x1];
      x1 = group[x];
      x2 = groupind[x];
    }
    return groupNode[x1][x2-d];
  }
}
;
template<class T> struct HLD_fenwick{
  HLD *hld;
  fenwick<T> *fen;
  void init(HLD *hld__, void **mem = &wmem){
    int i, j;
    hld = hld__;
    fen = (fenwick<T>*)(*mem);
    *mem = fen + hld->groupNum;
    for(i=0;i<hld->groupNum;i++){
      fen[i].walloc(hld->groupSize[i], mem);
      fen[i].init(hld->groupSize[i]);
    }
  }
  inline void add(int u, T val){
    int ug, ui;
    ug = hld->group[u];
    ui = hld->groupind[u];
    fen[ug].add(ui, val);
  }
  inline T get(int u, int v){
    T res;
    int ug, ui, vg, vi;
    ug = hld->group[u];
    vg = hld->group[v];
    res = 0;
    while(ug != vg){
      if(hld->groupDepth[ug] < hld->groupDepth[vg]){
        swap(u, v);
        swap(ug, vg);
      }
      res += fen[ug].get(hld->groupind[u]);
      u = hld->groupUpNode[ug];
      ug = hld->group[u];
    }
    ui = hld->groupind[u];
    vi = hld->groupind[v];
    res += fen[ug].range(min_L(ui, vi),max_L(ui, vi));
    return res;
  }
}
;
char memarr[96000000];
int N;
int Q;
int A[100000];
int B[100000];
int C[100000];
int D[100000];
int X[100000];
int Y[100000];
int U[100000];
int V[100000];
int ind[100000];
int val[100000];
long long res[100000];
graph g;
HLD hld;
HLD_fenwick<long long> t;
int up[100000];
int cnv[100000];
long long cur[100000];
inline void change(int i, long long val){
  i = cnv[i];
  t.add(i, val - cur[i]);
  cur[i] = val;
}
long long calc(int a, int b){
  int k;
  long long res;
  k = hld.lca(a,b);
  res = t.get(a,b) - t.get(k,k);
  return res;
}
int main(){
  int bk, cr, i, ii, j, k;
  long long r;
  wmem = memarr;
  rd(N);
  rd(Q);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<N-1;Lj4PdHRW++){
      rd(A[Lj4PdHRW]);A[Lj4PdHRW] += (-1);
      rd(B[Lj4PdHRW]);B[Lj4PdHRW] += (-1);
      rd(C[Lj4PdHRW]);
      rd(D[Lj4PdHRW]);
    }
  }
  {
    int KL2GvlyY;
    for(KL2GvlyY=0;KL2GvlyY<Q;KL2GvlyY++){
      rd(X[KL2GvlyY]);
      rd(Y[KL2GvlyY]);
      rd(U[KL2GvlyY]);U[KL2GvlyY] += (-1);
      rd(V[KL2GvlyY]);V[KL2GvlyY] += (-1);
    }
  }
  sortA_L(N-1, C, A, B, D);
  for(i=0;i<Q;i++){
    val[i] = X[i];
  }
  for(i=0;i<Q;i++){
    ind[i] = i;
  }
  sortA_L(Q, val, ind);
  g.setEdge(N, N-1, A, B);
  hld.init(g);
  t.init(&hld);
  for(i=0;i<N;i++){
    up[i] = hld.up(i);
  }
  for(i=0;i<N-1;i++){
    if(up[A[i]]==B[i]){
      cnv[i] =A[i];
    }
    else{
      cnv[i] =B[i];
    }
  }
  for(i=0;i<N-1;i++){
    change(i, D[i]);
  }
  bk = cr = 0;
  for(ii=0;ii<Q;ii++){
    i = ind[ii];
    while(cr < N-1 && C[cr] <= X[i]){
      change(cr, 10000000000LL);
      cr++;
    }
    while(bk < N-1 && C[bk] < X[i]){
      change(bk, D[bk]);
      bk++;
    }
    r = calc(U[i], V[i]);
    res[i] = (r%10000000000LL) + (r/10000000000LL) * Y[i];
  }
  for(i=0;i<Q;i++){
    wt_L(res[i]);
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20190708-1 [beta]

// --- original code ---
// int N, Q, A[1d5], B[1d5], C[1d5], D[1d5], X[1d5], Y[1d5], U[1d5], V[1d5];
// 
// int ind[1d5], val[1d5];
// ll res[1d5];
// 
// graph g;
// HLD hld;
// HLD_fenwick<ll> t;
// 
// int up[1d5], cnv[1d5];
// ll cur[1d5];
// 
// inline void change(int i, ll val){
//   i = cnv[i];
//   t.add(i, val - cur[i]);
//   cur[i] = val;
// }
// 
// ll calc(int a, int b){
//   int k;
//   ll res;
//   k = hld.lca(a,b);
//   res = t.get(a,b) - t.get(k,k);
//   return res;
// }
// 
// {
//   int i, j, k;
//   int bk, cr;
//   int ii;
//   ll r;
//   
//   rd(N,Q,(A--,B--,C,D)(N-1),(X,Y,U--,V--)(Q));
// 
//   sortA(N-1, C, A, B, D);
//   
//   rep(i,Q) val[i] = X[i];
//   rep(i,Q) ind[i] = i;
//   sortA(Q, val, ind);
// 
//   g.setEdge(N, N-1, A, B);
//   hld.init(g);
//   t.init(&hld);
// 
//   rep(i,N) up[i] = hld.up(i);
//   rep(i,N-1) cnv[i] = if[ up[A[i]]==B[i], A[i], B[i] ];
//   rep(i,N-1) change(i, D[i]);
// 
//   bk = cr = 0;
//   rep(ii,Q){
//     i = ind[ii];
// 
//     while(cr < N-1 && C[cr] <= X[i]){
//       change(cr, 1d10);
//       cr++;
//     }
//     while(bk < N-1 && C[bk] < X[i]){
//       change(bk, D[bk]);
//       bk++;
//     }
// 
//     r = calc(U[i], V[i]);
//     res[i] = (r%1d10) + (r/1d10) * Y[i];
//   }
// 
//   rep(i,Q) wt(res[i]);
// }


Measured memory_bytes: 15360