#include <bits/stdc++.h>   const int N = 100010;   int n;   int head[N], to[2 * N], next[2 * N], graphmr;   double ans;   inline void add(int x, int y) {     int p = graphmr++;     to[p] = y;     next[p] = head[x];     head[x] = p;   }   inline void dfs(int x, int fa, int dis) {     ans += 1.0 / dis;     for (int i = head[x]; ~i; i = next[i])       if (to[i] != fa) dfs(to[i], x, dis + 1);   }   int main() {     scanf( %d , &n);     memset(head, -1, sizeof head);     for (int i = 1, x, y; i < n; i++) {       scanf( %d%d , &x, &y);       add(x, y);       add(y, x);     }     dfs(1, 0, 1);     printf( %lf n , ans);     return 0;   }   