#include <bits/stdc++.h>
using namespace std;
vector<int> adj[111111];
int deep[111111], p[111111][20], n;
long long son[111111], Ed[111111], Eu[111111];
void dfs1(int u, int fa) {
  p[u][0] = fa;
  for (int i = 1; i < 20; i++) p[u][i] = p[p[u][i - 1]][i - 1];
  deep[u] = deep[fa] + 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    dfs1(v, u);
    son[u] += son[v] + 1;
    Ed[u] += Ed[v] + son[v] + 1;
  }
}
void dfs2(int u, int fa) {
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == fa) continue;
    Eu[v] =
        Eu[u] + n - son[u] - 1 + Ed[u] - Ed[v] - son[v] - 1 + son[u] - son[v];
    dfs2(v, u);
  }
}
int k_th(int u, int k) {
  for (int i = 0; i < 20; i++) {
    if ((1 << i) & k) u = p[u][i];
  }
  return u;
}
int lca(int u, int v) {
  if (deep[v] < deep[u]) swap(u, v);
  int df = deep[v] - deep[u];
  v = k_th(v, df);
  if (u == v) return u;
  for (int i = 19; i >= 0; i--) {
    if (p[u][0] == p[v][0]) break;
    if (p[u][i] != p[v][i]) u = p[u][i], v = p[v][i];
  }
  return p[u][0];
}
int main() {
  int m, i, j, u, v;
  cin >> n >> m;
  for (i = 0; i < n - 1; i++) {
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs1(1, 0);
  dfs2(1, 0);
  while (m--) {
    scanf("%d%d", &u, &v);
    if (deep[u] > deep[v]) swap(u, v);
    int uu = u, vv = v;
    int LCA = lca(uu, vv);
    if (LCA != u) {
      double ans = Ed[u] * (son[v] + 1) + Ed[v] * (son[u] + 1);
      ans /= (son[u] + 1) * (son[v] + 1);
      ans += deep[u] + deep[v] - 2 * deep[LCA] + 1;
      printf("%.9lf\n", ans);
    } else {
      int vvv = v;
      int w = k_th(vv, deep[vvv] - deep[u] - 1);
      double ans = Ed[v] * (n - son[w] - 1) + Eu[w] * (son[v] + 1);
      ans /= ((n - son[w] - 1) * (son[v] + 1));
      ans += deep[v] - deep[w] + 1;
      printf("%.9lf\n", ans);
    }
  }
  return 0;
}
