#include <bits/stdc++.h>
using namespace std;
const int N = 111000, M = 20;
struct edge {
  int t, next;
} e[N << 1];
int head[N], cnt;
int fa[N][M], dep[N];
int d[N], cnt2;
int son[N];
long long sum[N], ups[N];
int n, m;
void init() {
  memset(head, -1, sizeof(head));
  cnt = cnt2 = dep[0] = 0;
}
void dfs(int x, int pre = 0, int dd = 1) {
  dep[x] = dd++;
  son[x] = 1;
  sum[x] = 0;
  fa[x][0] = pre;
  d[++cnt2] = x;
  for (int i = head[x]; ~i; i = e[i].next)
    if (e[i].t != pre) {
      int v = e[i].t;
      dfs(v, x, dd);
      son[x] += son[v];
      sum[x] += sum[v] + son[v];
    }
}
void lcainit() {
  for (int i = 0; i < M; i++) fa[0][i] = 0;
  for (int j = 1; j < M; j++)
    for (int i = n; i; i--) fa[d[i]][j] = fa[fa[d[i]][j - 1]][j - 1];
}
int lca(int x, int y) {
  if (dep[x] > dep[y]) swap(x, y);
  for (int i = M - 1; i >= 0; i--)
    if (dep[fa[y][i]] >= dep[x]) y = fa[y][i];
  if (x == y) return x;
  for (int i = M - 1; i >= 0; i--)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return fa[x][0];
}
int lcason(int x, int y) {
  for (int i = M - 1; i >= 0; i--)
    if (dep[fa[x][i]] > dep[y]) x = fa[x][i];
  return x;
}
void dfs2(int x, int pre = 0) {
  if (x != 1)
    ups[x] = ups[pre] + n - son[x] + sum[pre] - sum[x] - son[x];
  else
    ups[x] = 0;
  for (int i = head[x]; ~i; i = e[i].next)
    if (e[i].t != pre) dfs2(e[i].t, x);
}
double calc(int x, int y) {
  if (dep[x] > dep[y]) swap(x, y);
  int z = lca(x, y);
  double a, b;
  int l;
  l = dep[x] + dep[y] - dep[z] - dep[z] + 1;
  if (z == x) {
    int s1;
    long long s2;
    z = lcason(y, x);
    s1 = n - son[z];
    s2 = ups[x] + sum[x] - (sum[z] + son[z]);
    a = (double)s2 / s1;
    b = (double)sum[y] / son[y];
  } else {
    a = (double)sum[x] / son[x];
    b = (double)sum[y] / son[y];
  }
  return a + b + l;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    init();
    for (int i = 1; i < n; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      e[cnt] = (edge){y, head[x]};
      head[x] = cnt++;
      e[cnt] = (edge){x, head[y]};
      head[y] = cnt++;
    }
    dfs(1);
    lcainit();
    dfs2(1);
    while (m--) {
      int x, y;
      scanf("%d%d", &x, &y);
      printf("%.8f\n", calc(x, y));
    }
  }
  return 0;
}
