#include <bits/stdc++.h>
using namespace std;
double ans = 0;
long long n, father[200000][21], que[200000], depth[200000], son[200000],
    dis[200000], rdis[200000];
vector<int> v[200000];
void bfs() {
  int head = 1, tail = 2;
  que[1] = depth[1] = 1;
  while (head < tail) {
    int cur = que[head++];
    for (int i = 0, sz = v[cur].size(); i < sz; i++) {
      int nex = v[cur][i];
      if (!depth[nex]) {
        depth[nex] = depth[cur] + 1;
        father[nex][0] = cur;
        que[tail++] = nex;
      }
    }
  }
  for (int i = n; i; i--) {
    int cur = que[i];
    son[father[cur][0]] += ++son[cur];
    dis[father[cur][0]] += dis[cur] + son[cur];
  }
  rdis[1] = dis[1];
  for (int i = 2; i <= n; i++) {
    int cur = que[i];
    rdis[cur] = rdis[father[cur][0]] - son[cur] * 2 + n;
  }
}
void initlca() {
  for (int i = 1; i <= n; i++) {
    int cur = que[i];
    for (int j = 0; j < 20; j++) father[cur][j + 1] = father[father[cur][j]][j];
  }
}
int getanc(int x, int dep) {
  for (int i = 20; i >= 0; i--)
    if (depth[father[x][i]] >= dep) x = father[x][i];
  return x;
}
int getlca(int x, int y) {
  if (depth[x] < depth[y]) swap(x, y);
  x = getanc(x, depth[y]);
  if (x == y) return x;
  for (int i = 20; i >= 0; i--)
    if (father[x][i] != father[y][i]) {
      x = father[x][i];
      y = father[y][i];
    }
  return father[x][0];
}
int main() {
  int m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  bfs();
  initlca();
  while (m--) {
    scanf("%d%d", &x, &y);
    int lca = getlca(x, y);
    if (lca == y) swap(x, y);
    if (lca == x) {
      int anc = getanc(y, depth[x] + 1);
      long long r = rdis[x] - (dis[anc] + son[anc]);
      printf("%.10f\n", depth[y] - depth[x] + 1 +
                            ((double)son[y] * r + (n - son[anc]) * dis[y]) /
                                son[y] / (n - son[anc]));
    } else
      printf("%.10f\n",
             depth[x] + depth[y] - depth[lca] * 2 + 1 +
                 ((double)son[x] * dis[y] + son[y] * dis[x]) / son[y] / son[x]);
  }
  return 0;
}
