#include <bits/stdc++.h>
using namespace std;
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
//#define int long long
struct IoSetup {
    IoSetup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
}IoSetup;

using Int = int;
using ll = long long;
using pii = pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int SMOD = 1000000007;
constexpr int NMOD = 998244353;
constexpr int dx[]={1,0,-1,0,1,1,-1,-1};
constexpr int dy[]={0,-1,0,1,-1,1,-1,1};

inline bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>bool chmax(T &a, const T&b){if(a<b)return(a=b,1);return 0;}
template<class T>bool chmin(T &a, const T&b){if(b<a)return(a=b,1);return 0;}

template< typename sum_t, typename key_t >
struct ReRooting {
    struct Edge {
        int to;
        key_t data;
        sum_t dp, ndp;
    };

    using F = function< sum_t(sum_t, sum_t) >;
    using G = function< sum_t(sum_t, key_t) >;

    vector< vector< Edge > > g;
    vector< sum_t > subdp, dp;
    const sum_t ident;
    const F f;
    const G gg;

    ReRooting(int V, const F f, const G g, const sum_t &ident)
        : g(V), f(f), gg(g), ident(ident), subdp(V, ident), dp(V, ident) {}

    void add_edge(int u, int v, const key_t &d = key_t(1)) {
        g[u].emplace_back((Edge) {v, d, ident, ident});
        g[v].emplace_back((Edge) {u, d, ident, ident});
    }

    void add_edge_bi(int u, int v, const key_t &d, const key_t &e) {
        g[u].emplace_back((Edge) {v, d, ident, ident});
        g[v].emplace_back((Edge) {u, e, ident, ident});
    }

    void dfs_sub(int idx, int par) {
        for(auto &e : g[idx]) {
            if(e.to == par) continue;
            dfs_sub(e.to, idx);
            subdp[idx] = f(subdp[idx], gg(subdp[e.to], e.data));
        }
    }

    void dfs_all(int idx, int par, const sum_t &top) {
        sum_t buff{ident};
        for(int i = 0; i < (int) g[idx].size(); i++) {
            auto &e = g[idx][i];
            e.ndp = buff;
            e.dp = gg(par == e.to ? top : subdp[e.to], e.data);
            buff = f(buff, e.dp);
        }
        dp[idx] = buff;
        buff = ident;
        for(int i = (int) g[idx].size() - 1; i >= 0; i--) {
            auto &e = g[idx][i];
            if(e.to != par) dfs_all(e.to, idx, f(e.ndp, buff));
            e.ndp = f(e.ndp, buff);
            buff = f(buff, e.dp);
        }
    }

    vector< sum_t > build() {
        dfs_sub(0, -1);
        dfs_all(0, -1, ident);
        return dp;
    }
};

signed main() {

    int n;
    cin >> n;

    using P = pair<double, int>;

    auto f1 = [](P a, P b) {
        return P(a.first + b.first, a.second + b.second);
    };

    auto f2 = [](P a, int data) {
        return P((a.second?a.first/a.second:0) + 1.0, 1);
    };

    ReRooting<P, int> g(n, f1, f2, P(0.0,0));

    for(int i = 1; i < n; i++) {
        int s, t;
        cin >> s >> t;
        s--,--t;

        g.add_edge(s, t);
    }

    for(auto&p:g.build()) {
        cout << (p.second?p.first/p.second:0.0) << endl;
    }

    return 0;
}

Measured memory_bytes: 50192