#include <bits/stdc++.h>
using namespace std;
const int maxN = 100005;
int dp[maxN][20], parent[maxN], level[maxN];
int n;
void init() {
  for (int i = 0; i < n; ++i)
    for (int j = 0; 1 << j < n; ++j) dp[i][j] = -1;
  for (int i = 0; i < n; ++i) dp[i][0] = parent[i];
  for (int j = 1; 1 << j < n; ++j)
    for (int i = 0; i < n; ++i)
      if (dp[i][j - 1] != -1) dp[i][j] = dp[dp[i][j - 1]][j - 1];
}
int lca(int a, int b) {
  if (level[a] < level[b]) swap(a, b);
  int log;
  for (log = 1; level[a] - (1 << log) >= 0; log++)
    ;
  log--;
  for (int i = log; i >= 0; i--)
    if (level[a] - (1 << i) >= level[b]) a = dp[a][i];
  if (a == b) return a;
  for (int i = log; i >= 0; i--)
    if (dp[a][i] != -1 && dp[a][i] != dp[b][i]) a = dp[a][i], b = dp[b][i];
  return parent[a];
}
vector<int> g[maxN];
bool used[maxN];
void make(int u) {
  for (int next : g[u]) {
    parent[next] = u;
    level[next] = 1 + level[u];
    make(next);
  }
}
void fix(int u) {
  used[u] = true;
  for (int i = 0; i < g[u].size(); ++i) {
    int next = g[u][i];
    if (!used[next]) {
      fix(next);
    } else {
      swap(g[u][i], g[u].back());
      g[u].pop_back();
      i--;
    }
  }
}
long long sum[maxN];
int children[maxN];
void dfs(int u) {
  children[u] = 1;
  for (int next : g[u]) {
    dfs(next);
    sum[u] += children[next] + sum[next];
    children[u] += children[next];
  }
}
long long sumparent[maxN];
long long all[maxN];
void dfs2(int u) {
  all[u] = sum[u];
  if (parent[u] != -1) {
    all[u] += all[parent[u]] - sum[u] - children[u] + n - children[u];
    sumparent[u] = all[parent[u]] - sum[u] - children[u] + n - children[u];
  }
  for (int next : g[u]) {
    dfs2(next);
  }
}
int main() {
  int m, x, y;
  cin >> n >> m;
  for (int i = 0; i < n - 1; ++i) {
    scanf("%d %d", &x, &y);
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  fix(0);
  parent[0] = -1;
  level[0] = 0;
  make(0);
  init();
  dfs(0);
  dfs2(0);
  while (m--) {
    scanf("%d %d", &x, &y);
    x--;
    y--;
    if (level[x] > level[y]) {
      swap(x, y);
    }
    int ll = lca(x, y);
    int d = level[x] + level[y] - 2 * level[ll] + 1;
    double answer = 0;
    if (ll == x) {
      int current = y;
      for (int i = 20; i >= 0; i--) {
        if (level[current] - (1 << i) - 1 >= level[x]) {
          current = dp[current][i];
        }
      }
      int cx = n - children[current];
      long long sumxx =
          sum[x] - sum[current] - children[current] + sumparent[x];
      answer = d + (1.0 * sumxx * children[y] + 1.0 * sum[y] * cx) /
                       (1.0 * children[y] * cx);
    } else {
      answer = d + (1.0 * sum[x] * children[y] + 1.0 * sum[y] * children[x]) /
                       (1.0 * children[x] * children[y]);
    }
    printf("%.15f\n", answer);
  }
  return 0;
}
