#include <bits/stdc++.h>
using namespace std;
struct node {
  int dnum, unum, dep, up[20];
  long long dsum, usum;
} tree[100010];
int n, m;
int h[100010], e[200010], nex[200010];
void dfs(int x) {
  node &now = tree[x];
  for (int i = h[x]; i; i = nex[i]) {
    if (e[i] == now.up[0]) continue;
    tree[e[i]].unum = n - (tree[e[i]].dnum + 1);
    long long ut = tree[x].usum;
    long long dt = tree[x].dsum - tree[e[i]].dsum - (tree[e[i]].dnum + 1);
    tree[e[i]].usum = (ut + dt) + tree[e[i]].unum;
    dfs(e[i]);
  }
}
void build(int x) {
  node &now = tree[x];
  now.dep = tree[now.up[0]].dep + 1;
  for (int i = 1; i <= 17; ++i) {
    if (now.up[i - 1] == 0 || tree[now.up[i - 1]].up[i - 1] == 0) break;
    now.up[i] = tree[now.up[i - 1]].up[i - 1];
  }
  for (int i = h[x]; i; i = nex[i]) {
    if (e[i] == now.up[0]) continue;
    tree[e[i]].up[0] = x;
    build(e[i]);
    now.dnum += tree[e[i]].dnum + 1;
    now.dsum += tree[e[i]].dsum + tree[e[i]].dnum + 1;
  }
  return;
}
bool st(int a, int b, int &tar, int &len) {
  len = 0;
  if (tree[a].dep != tree[b].dep) {
    for (int i = 17; i >= 0; --i) {
      int ta = tree[a].up[i];
      if (ta && tree[ta].dep >= tree[b].dep + 1) a = ta, len += (1 << i);
    }
    ++len;
    tar = a;
    if (tree[a].up[0] == b) return false;
    a = tree[a].up[0];
  }
  for (int i = 17; i >= 0; --i) {
    if (tree[a].up[i] != tree[b].up[i]) {
      len += (1 << (i + 1));
      a = tree[a].up[i];
      b = tree[b].up[i];
    }
  }
  len += 2;
  return true;
}
void init() {
  cin >> n >> m;
  int a, b, tp = 0, tar;
  int len;
  double ans;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &a, &b);
    e[++tp] = b;
    nex[tp] = h[a];
    h[a] = tp;
    e[++tp] = a;
    nex[tp] = h[b];
    h[b] = tp;
  }
  build(1);
  dfs(1);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a, &b);
    if (tree[a].dep < tree[b].dep) swap(a, b);
    if (st(a, b, tar, len)) {
      ans = len + 1;
      double t1 = tree[a].dsum * (tree[b].dnum + 1);
      double t2 = tree[b].dsum * (tree[a].dnum + 1);
      ans += (t1 + t2) / ((tree[a].dnum + 1) * (tree[b].dnum + 1));
    } else {
      long long tsum = tree[b].dsum - tree[tar].dsum - (tree[tar].dnum + 1);
      tsum += tree[b].usum;
      long long tnum = n - tree[tar].dnum - 1;
      double t1 = tree[a].dsum * tnum;
      double t2 = tsum * (tree[a].dnum + 1);
      ans = len + 1;
      ans += (t1 + t2) / ((tree[a].dnum + 1) * tnum);
    }
    printf("%.8f\n", ans);
  }
  return;
}
int main() {
  init();
  return 0;
}
