#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200 * 1000 + 10, LOG = 20 + 5;
int n, m, par[MAX_N][LOG], h[MAX_N], cnt[MAX_N];
long long dp[MAX_N][2];
vector<int> adj[MAX_N];
void dfs_down(int u = 0) {
  for (int i = 1; i < LOG; i++) par[u][i] = par[par[u][i - 1]][i - 1];
  for (auto v : adj[u])
    if (v != par[u][0]) {
      par[v][0] = u, h[v] = h[u] + 1, dfs_down(v);
      cnt[u] += cnt[v], dp[u][0] += dp[v][0];
    }
  dp[u][0] += cnt[u]++;
}
void dfs_up(int u = 0) {
  if (par[u][0] != u)
    dp[u][1] = dp[par[u][0]][0] + dp[par[u][0]][1] - dp[u][0] - 2 * cnt[u] + n;
  for (auto v : adj[u])
    if (v != par[u][0]) dfs_up(v);
}
int get_par(int u, int k) {
  for (int i = 0; i < LOG; i++)
    if ((k >> i) & 1) u = par[u][i];
  return u;
}
int lca(int u, int v) {
  if (h[u] > h[v]) swap(u, v);
  v = get_par(v, h[v] - h[u]);
  for (int i = LOG - 1; ~i; i--)
    if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];
  return u == v ? u : par[u][0];
}
int dist(int u, int v) { return h[u] + h[v] - 2 * h[lca(u, v)]; }
double solve(int u, int v) {
  if (h[u] > h[v]) swap(u, v);
  int a = cnt[u], b = cnt[v];
  long long d1 = dp[u][0], d2 = dp[v][0];
  if (lca(u, v) == u) {
    int x = get_par(v, h[v] - h[u] - 1);
    a = n - cnt[x], d1 = dp[x][1] - n + cnt[x];
  }
  return 1. * d1 / a + 1. * d2 / b + dist(u, v) + 1;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int m;
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs_down(), dfs_up();
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    cout << fixed << setprecision(10) << solve(u, v) << endl;
  }
  return 0;
}
