#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100009;
const int MAXLOG = 20;
vector<int> nbr[MAXN];
long long int depth[MAXN], sumLen[MAXN], subSize[MAXN], upLen[MAXN],
    jump[MAXLOG][MAXN];
int n;
int go(int u, int h) {
  for (int i = 0; (1 << i) <= h; i++) {
    if ((1 << i) & h) {
      u = jump[i][u];
    }
  }
  return u;
}
void dfs(int u, int par) {
  depth[u] = depth[par] + 1;
  upLen[u] = jump[0][u] = par;
  for (int i = 1; jump[i - 1][u] != 0; i++) {
    jump[i][u] = jump[i - 1][jump[i - 1][u]];
  }
  subSize[u] = 1;
  for (int v : nbr[u]) {
    if (v != par) {
      dfs(v, u);
      subSize[u] += subSize[v];
      sumLen[u] += subSize[v] + sumLen[v];
    }
  }
}
void dfsUp(int u, int par) {
  if (u != 0) {
    upLen[u] =
        upLen[par] + sumLen[par] - sumLen[u] - subSize[u] + n - subSize[u];
  }
  for (int v : nbr[u]) {
    if (v != par) {
      dfsUp(v, u);
    }
  }
}
int lca(int a, int b, int& jmp) {
  jmp = depth[b] - depth[a];
  b = go(b, jmp);
  if (a == b) {
    return a;
  }
  for (int i = 32 - __builtin_clz(depth[a]); i >= 0; --i) {
    if (jump[i][a] != jump[i][b]) {
      jmp += (1 << i);
      a = jump[i][a];
      b = jump[i][b];
    }
  }
  jmp++;
  return jump[0][a];
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << setprecision(30);
  int m;
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    nbr[a].push_back(b);
    nbr[b].push_back(a);
  }
  dfs(0, 0);
  dfsUp(0, 0);
  while (m--) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    if (depth[a] > depth[b]) {
      swap(a, b);
    }
    int jmp;
    int anc = lca(a, b, jmp);
    double result = 1 + jmp + (depth[a] - depth[b] + jmp);
    result += 1. * sumLen[b] / subSize[b];
    if (anc != a) {
      result += 1. * sumLen[a] / subSize[a];
    } else {
      int child = go(b, jmp - 1);
      long long int sLen =
          sumLen[a] - sumLen[child] - subSize[child] + upLen[a];
      long long int sSize = subSize[a] - subSize[child] + n - subSize[a];
      result += 1. * sLen / sSize;
    }
    cout << result << '\n';
  }
  return 0;
}
