usingnamespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); constint N = 2e2 + 10; constint M = 1e6 + 10; constint INF = 0x3f3f3f3f; constlonglong LINF = 0x3f3f3f3f3f3f3f3f; constint mod = 1e9 + 7; constdouble eps = 1e-3; longlong dp[N][N]; int father[N][30]; int lg; structnode{ int v, next; }a[M]; int f[N], cnt; voidadd(int u, int v){ a[++cnt].v = v, a[cnt].next = f[u], f[u] = cnt; } int dep[N]; voiddfs(int u, int fa, int deep){ dep[u] = deep; for (int i = f[u]; i; i = a[i].next) { int v = a[i].v; if(v == fa) continue; father[v][0] = u; for (int j = 1; j <= lg; j++) father[v][j] = father[father[v][j - 1]][j - 1]; dfs(v, u, deep + 1); } } int inv2; longlongfastpow(longlong a, longlong k){ longlong res = 1; while(k) { if(k & 1) res = res * a % mod; a = a * a % mod; k >>= 1; } return res; } intlca(int u, int v){ if(dep[u] < dep[v]) swap(u, v); for (int i = lg; i >= 0; i--) { if(dep[father[u][i]] >= dep[v]) u = father[u][i]; } if(u == v) return u; for (int i = lg; i >= 0; i--) { if(father[u][i] != father[v][i]){ u = father[u][i]; v = father[v][i]; } } return father[u][0]; } intmain(){ inv2 = fastpow(2, mod - 2); int n; cin >> n; int invn = fastpow(n, mod - 2); for (int i = 1; i < n; i++) { int u, v; scanf("%d%d", &u, &v); add(u, v); add(v, u); } for (int i = 1; i <= n; i++) { dp[i][0] = 1; } for (int i = 1; i <= n; i++ ) { for (int j = 1; j <= n; j++) dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod * inv2 % mod; } lg = (int)log(n) / log(2); longlong ans = 0; for (int i = 1; i <= n; i++) { memset(father, 0, sizeof father); dfs(i, 0, 1); for (int a = 1; a <= n; a++) { for (int b = a + 1; b <= n; b++) { int l = lca(a, b); ans = (ans + dp[dep[a] - dep[l]][dep[b] - dep[l]] * invn % mod) % mod; } } } cout << ans << '\n'; return0; }