func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> t[100000];   int n;   int h[100000];   int arr[100000];   double fac[100001];   bool cmp(int a, int b) { return h[a] < h[b]; }   void dfs(int cur, int he, int par = -1) {     h[cur] = he;     for (int i = 0; i < t[cur].size(); i++) {       if (t[cur][i] == par) continue;       dfs(t[cur][i], he + 1, cur);     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 1; i++) {       int a, b;       cin >> a >> b;       t[a - 1].push_back(b - 1);       t[b - 1].push_back(a - 1);     }     dfs(0, 1);     for (int i = 0; i < n; i++) arr[i] = i;     sort(arr, arr + n, cmp);     double ans = 1;     fac[0] = 1;     fac[1] = 1;     for (int i = 2; i <= n; i++) fac[i] = 1.0 / i;     for (int i = 1; i < n; i++) {       ans = (ans + 1) * fac[h[i]] + ans * (1 - fac[h[i]]);     }     printf( %.9lf n , ans);     return 0;   }   