QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#716625#9532. 长野原龙势流星群konata2828Compile Error//C++2361.3kb2024-11-06 15:41:382024-11-06 15:41:38

Judging History

你现在查看的是最新测评结果

  • [2024-11-06 15:41:38]
  • 评测
  • [2024-11-06 15:41:38]
  • 提交

answer

// Hydro submission #672b1db0a059678966636aea@1730878896563
#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}#include <bits/stdc++.h>

using LL = long long;

constexpr int N = 200005;

int n;
LL a[N];
int fa[N], par[N], size[N];
double ans[N];

struct Frac {
    LL x, y;
    friend bool operator<(Frac a, Frac b) { return __int128(a.x) * b.y < __int128(b.x) * a.y; }
};

int get_par(int x) { return par[x] == x ? x : par[x] = get_par(par[x]); }

int main() {
    std::cin >> n;
    for (int i = 2; i <= n; i++) std::cin >> fa[i];
    for (int i = 1; i <= n; i++) std::cin >> a[i];
    std::priority_queue<std::pair<Frac, int>> que;
    std::fill_n(size + 1, n, 1);
    std::iota(par + 1, par + n + 1, 1);
    for (int i = 1; i <= n; i++) que.push({{a[i], size[i]}, i});
    while (que.size()) {
        auto [v, x] = que.top();
        que.pop();
        if (v.y != size[x]) continue;
        ans[x] = 1. * v.x / v.y;
        if (fa[x]) {
            int y = get_par(fa[x]);
            a[y] += a[x];
            size[y] += size[x];
            que.push({{a[y], size[y]}, y});
        }
    }
    for (int i = 1; i <= n; i++) printf("%.10lf\n", ans[i]);
    return 0;
}

详细

answer.code:42:2: error: stray ‘#’ in program
   42 | }#include <bits/stdc++.h>
      |  ^
answer.code:82:2: error: stray ‘#’ in program
   82 | }#include <bits/stdc++.h>
      |  ^
answer.code:122:2: error: stray ‘#’ in program
  122 | }#include <bits/stdc++.h>
      |  ^
answer.code:162:2: error: stray ‘#’ in program
  162 | }#include <bits/stdc++.h>
      |  ^
answer.code:202:2: error: stray ‘#’ in program
  202 | }#include <bits/stdc++.h>
      |  ^
answer.code:242:2: error: stray ‘#’ in program
  242 | }#include <bits/stdc++.h>
      |  ^
answer.code:282:2: error: stray ‘#’ in program
  282 | }#include <bits/stdc++.h>
      |  ^
answer.code:322:2: error: stray ‘#’ in program
  322 | }#include <bits/stdc++.h>
      |  ^
answer.code:362:2: error: stray ‘#’ in program
  362 | }#include <bits/stdc++.h>
      |  ^
answer.code:402:2: error: stray ‘#’ in program
  402 | }#include <bits/stdc++.h>
      |  ^
answer.code:442:2: error: stray ‘#’ in program
  442 | }#include <bits/stdc++.h>
      |  ^
answer.code:482:2: error: stray ‘#’ in program
  482 | }#include <bits/stdc++.h>
      |  ^
answer.code:522:2: error: stray ‘#’ in program
  522 | }#include <bits/stdc++.h>
      |  ^
answer.code:562:2: error: stray ‘#’ in program
  562 | }#include <bits/stdc++.h>
      |  ^
answer.code:602:2: error: stray ‘#’ in program
  602 | }#include <bits/stdc++.h>
      |  ^
answer.code:642:2: error: stray ‘#’ in program
  642 | }#include <bits/stdc++.h>
      |  ^
answer.code:682:2: error: stray ‘#’ in program
  682 | }#include <bits/stdc++.h>
      |  ^
answer.code:722:2: error: stray ‘#’ in program
  722 | }#include <bits/stdc++.h>
      |  ^
answer.code:762:2: error: stray ‘#’ in program
  762 | }#include <bits/stdc++.h>
      |  ^
answer.code:802:2: error: stray ‘#’ in program
  802 | }#include <bits/stdc++.h>
      |  ^
answer.code:842:2: error: stray ‘#’ in program
  842 | }#include <bits/stdc++.h>
      |  ^
answer.code:882:2: error: stray ‘#’ in program
  882 | }#include <bits/stdc++.h>
      |  ^
answer.code:922:2: error: stray ‘#’ in program
  922 | }#include <bits/stdc++.h>
      |  ^
answer.code:962:2: error: stray ‘#’ in program
  962 | }#include <bits/stdc++.h>
      |  ^
answer.code:1002:2: error: stray ‘#’ in program
 1002 | }#include <bits/stdc++.h>
      |  ^
answer.code:1042:2: error: stray ‘#’ in program
 1042 | }#include <bits/stdc++.h>
      |  ^
answer.code:1082:2: error: stray ‘#’ in program
 1082 | }#include <bits/stdc++.h>
      |  ^
answer.code:1122:2: error: stray ‘#’ in program
 1122 | }#include <bits/stdc++.h>
      |  ^
answer.code:1162:2: error: stray ‘#’ in program
 1162 | }#include <bits/stdc++.h>
      |  ^
answer.code:1202:2: error: stray ‘#’ in program
 1202 | }#include <bits/stdc++.h>
      |  ^
answer.code:1242:2: error: stray ‘#’ in program
 1242 | }#include <bits/stdc++.h>
      |  ^
answer.code:1282:2: error: stray ‘#’ in program
 1282 | }#include <bits/stdc++.h>
      |  ^
answer.code:1322:2: error: stray ‘#’ in program
 1322 | }#include <bits/stdc++.h>
      |  ^
answer.code:1362:2: error: stray ‘#’ in program
 1362 | }#include <bits/stdc++.h>
      |  ^
answer.code:1402:2: error: stray ‘#’ in program
 1402 | }#include <bits/stdc++.h>
      |  ^
answer.code:1442:2: error: stray ‘#’ in program
 1442 | }#include <bits/stdc++.h>
      |  ^
answer.code:1482:2: error: stray ‘#’ in program
 1482 | }#include <bits/stdc++.h>
      |  ^
answer.code:1522:2: error: stray ‘#’ in program
 1522 | }#include <bits/stdc++.h>
      |  ^
answer.code:1562:2: error: stray ‘#’ in program
 1562 | }#include <bits/stdc++.h>
      |  ^
answer.code:1602:2: error: stray ‘#’ in program
 1602 | }#include <bits/stdc++.h>
      |  ^
answer.code:1642:2: error: stray ‘#’ in program
 1642 | }#include <bits/stdc++.h>
      |  ^
answer.code:1682:2: error: stray ‘#’ in program
 1682 | }#include <bits/stdc++.h>
      |  ^
answer.code:1722:2: error: stray ‘#’ in program
 1722 | }#include <bits/stdc++.h>
      |  ^
answer.code:1762:2: error: stray ‘#’ in program
 1762 | }#include <bits/stdc++.h>
      |  ^
answer.code:1802:2: error: stray ‘#’ in program
 1802 | }#include <bits/stdc++.h>
      |  ^
answer.code:1842:2: error: stray ‘#’ in program
 1842 | }#include <bits/stdc++.h>
      |  ^
answer.code:1882:2: error: stray ‘#’ in program
 1882 | }#include <bits/stdc++.h>
      |  ^
answer.code:1922:2: error: stray ‘#’ in program
 1922 | }#include <bits/stdc++.h>
      |  ^
answer.code:1962:2: error: stray ‘#’ in program
 1962 | }#include <bits/stdc++.h>
      |  ^
answer.code:2002:2: error: stray ‘#’ in program
 2002 | }#include <bits/stdc++.h>
      |  ^
answer.code:2042:2: error: stray ‘#’ in program
 2042 | }#include <bits/stdc++.h>
      |  ^
answer.code:2082:2: error: stray ‘#’ in program
 2082 | }#include <bits/stdc++.h>
      |  ^
answer.code:2122:2: error: stray ‘#’ in program
 2122 | }#include <bits/stdc++.h>
      |  ^
answer.code:2162:2: error: stray ‘#’ in program
 2162 | }#include <bits/stdc++.h>
      |  ^
answ...