#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 15;
int sz[N], par[N][20], d[N], n;
long long up[N], dw[N];
vector<int> adj[N];
void dfs(int x, int p) {
  sz[x]++;
  int i, u;
  d[x] = d[p] + 1;
  par[x][0] = p;
  for (i = 1; i < 20; ++i) par[x][i] = par[par[x][i - 1]][i - 1];
  for (i = 0; i < adj[x].size(); ++i) {
    u = adj[x][i];
    if (u != p) {
      dfs(u, x);
      sz[x] += sz[u];
      dw[x] += dw[u] + sz[u];
    }
  }
}
void dfs2(int x, int p, long long c) {
  int u, i, cur;
  long long tot;
  up[x] = c;
  for (i = 0; i < adj[x].size(); ++i) {
    u = adj[x][i];
    if (u != p) {
      cur = n - sz[u];
      tot = c + dw[x] - (dw[u] + sz[u]) + cur;
      dfs2(u, x, tot);
    }
  }
}
int main() {
  int j, u, m, i, a, b, diff, c;
  cin >> n >> m;
  for (i = 0; i < n - 1; ++i)
    scanf("%d%d", &a, &b), adj[a].push_back(b), adj[b].push_back(a);
  dfs(1, 0);
  dfs2(1, 0, 0);
  double ret;
  for (i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    if (d[a] < d[b]) swap(a, b);
    diff = d[a] - d[b];
    u = a;
    c = a;
    for (j = 0; j < 20; ++j) {
      if (diff & (1 << j)) u = par[u][j];
      if ((diff - 1) & (1 << j)) c = par[c][j];
    }
    if (u == b) {
      ret = diff + 1;
      ret += (double)(up[c] - (n - sz[c])) / (n - sz[c]);
      ret += (double)dw[a] / (sz[a]);
    } else {
      c = b;
      for (j = 19; j >= 0; --j)
        if (par[u][j] != par[c][j]) u = par[u][j], c = par[c][j];
      c = par[c][0];
      ret = d[a] - d[c] + d[b] - d[c] + 1;
      ret += (double)dw[a] / sz[a];
      ret += (double)dw[b] / sz[b];
    }
    printf("%0.9lf\n", ret);
  }
}
