#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 10, M = 1e6 + 20;
vector<int> adj[N];
pair<long long, long long> fen[M];
int n, x[N], t[N], l[N], par[N], m1[N], m2[N];
long long T, w[N], first[N], mx1[N], mx2[N], d[N];
void read_input() {
  cin >> n >> T;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) cin >> t[i];
  for (int i = 1; i < n; i++) {
    cin >> par[i] >> l[i];
    par[i]--;
    adj[par[i]].push_back(i);
  }
}
void add(int id, int q) {
  for (int p = t[id] + 1; p < M; p += p & -p)
    fen[p].first += 1LL * x[id] * q, fen[p].second += 1LL * x[id] * t[id] * q;
}
pair<long long, long long> get(int p) {
  pair<long long, long long> ans = make_pair(0, 0);
  for (p++; p; p -= p & -p)
    ans.first += fen[p].first, ans.second += fen[p].second;
  return ans;
}
void dfs(int v) {
  add(v, 1);
  for (int u : adj[v]) {
    w[u] = w[v] + l[u];
    dfs(u);
    if (d[u] >= mx1[v])
      mx2[v] = mx1[v], m2[v] = m1[v], mx1[v] = d[u], m1[v] = u;
    else if (d[u] > mx2[v])
      mx2[v] = d[u], m2[v] = u;
  }
  int L = 0, R = M - 10;
  while (R - L > 1) {
    int mid = (R + L) >> 1;
    (get(mid).second <= (T - 2 * w[v]) ? L = mid : R = mid);
  }
  first[v] = get(L).first + min(get(R).first - get(L).first,
                                ((T - 2 * w[v] - get(L).second) / R));
  if (v == 0)
    d[v] = max(first[v], mx1[v]);
  else
    d[v] = (adj[v].size() < 2 ? first[v] : max(first[v], mx2[v]));
  add(v, -1);
}
void solve() {
  dfs(0);
  cout << d[0];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read_input(), solve();
  return 0;
}
