func_code_string: #include <bits/stdc++.h>   using namespace std;   int a[100001];   vector<int> v[100001];   int it = 1;   long double e[100001];   int dfs(const int i) {     a[i] = 1;     for (int j : v[i]) {       int p = dfs(j);       a[i] += p;     }     return a[i];   }   void dfs2(int i, long double t) {     e[i] = t;     for (int j : v[i]) {       dfs2(j, t + ((long double)(a[i] - a[j] - 1)) / 2 + 1.0);     }   }   int main() {     int n;     cin >> n;     for (int i = 2; i <= n; i++) {       int a;       cin >> a;       v[a].push_back(i);     }     dfs(1);     dfs2(1, 1.0);     cout << setprecision(10);     for (int i = 1; i <= n; i++) {       cout << e[i] <<    ;     }     cout << endl;   }   