#include <bits/stdc++.h>
using namespace std;
vector<int> tree[100001];
vector<long long> ch2[100001];
vector<long long> vch2[100001];
vector<bool> vis(100001, 0);
vector<bool> v(100001, 0);
vector<int> parent(100001);
vector<int> p(100001);
vector<int> num(100001);
vector<int> l;
vector<int> r;
vector<double> ans;
vector<int> depth(100001);
vector<long long> children(100001);
vector<long long> vch(100001);
vector<double> val(100001);
int lca[100001][20];
int lgn;
int n, m;
void dfs(int x) {
  lca[x][0] = parent[x];
  for (int i = 1; i < lgn; i++) {
    lca[x][i] = lca[lca[x][i - 1]][i - 1];
  }
  for (int i = 0; i < tree[x].size(); i++) {
    int j = tree[x][i];
    if (vis[j]) continue;
    vis[j] = 1;
    parent[j] = x;
    depth[j] = depth[x] + 1;
    dfs(j);
  }
}
int find(int x, int h) {
  if (h == 0) return x;
  if (h == 1) return parent[x];
  int lst = 0;
  for (int i = 0; i < lgn; i++) {
    int tmp = (1 << i);
    if ((h & tmp) > 0) {
      lst = i;
      break;
    }
  }
  int y = lca[x][lst];
  return find(y, h - (1 << lst));
}
int lcs(int x, int y) {
  if (depth[x] > depth[y])
    x = find(x, depth[x] - depth[y]);
  else if (depth[y] > depth[x])
    y = find(y, depth[y] - depth[x]);
  if (x == y) return x;
  if (parent[x] == parent[y]) return parent[x];
  int lst = 0;
  for (int i = 1; i < lgn; i++) {
    if (lca[x][i] == lca[y][i]) {
      lst = i - 1;
      break;
    }
  }
  return lcs(lca[x][lst], lca[y][lst]);
}
void fill(int x) {
  children[x] = 1;
  vch[x] = 0;
  for (int i = 0; i < tree[x].size(); i++) {
    int j = tree[x][i];
    if (v[j]) continue;
    v[j] = 1;
    num[j] = i;
    p[j] = x;
    fill(j);
    children[x] += children[j];
    vch[x] += vch[j] + children[j];
  }
  val[x] = (1.0 * vch[x]) / (1.0 * children[x]);
}
void fill2(int x) {
  long long tot;
  if (p[x] == 0) {
    tot = vch[x];
  } else
    tot = vch2[parent[x]][num[x]] + n - children[x] + vch[x];
  for (int i = 0; i < tree[x].size(); i++) {
    int j = tree[x][i];
    if (j == p[x]) continue;
    ch2[x][i] = n - children[j];
    vch2[x][i] = tot - vch[j] - children[j];
    fill2(j);
  }
}
int main() {
  cin >> n >> m;
  lgn = log2(n) + 2;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    tree[x].push_back(y);
    tree[y].push_back(x);
    ch2[x].push_back(0);
    vch2[x].push_back(0);
    ch2[y].push_back(0);
    vch2[y].push_back(0);
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    l.push_back(x);
    r.push_back(y);
    ans.push_back(0.0);
  }
  parent[1] = 0;
  depth[1] = 0;
  p[1] = 0;
  vis[1] = 1;
  dfs(1);
  v[1] = 1;
  fill(1);
  fill2(1);
  for (int i = 0; i < m; i++) {
    int x = l[i];
    int y = r[i];
    if (depth[x] > depth[y]) {
      int temp = x;
      x = y;
      y = temp;
    }
    int f = lcs(x, y);
    if (f == 0) {
      cout << "sjgjgl" << endl;
    }
    if (f != x && f != y) {
      int dist = depth[x] - depth[f] + depth[y] - depth[f] + 1;
      if (dist < 0) {
        cout << "waaah" << endl;
      }
      ans[i] = val[x] + val[y] + dist;
    } else {
      int dist = depth[y] - depth[x];
      if (dist < 0) {
        cout << "waaah" << endl;
      }
      int last = find(y, dist - 1);
      double c1 = ch2[x][num[last]];
      double c2 = vch2[x][num[last]];
      if (val[y] < 0) {
        cout << "waaah1" << endl;
      }
      if (c1 < 0) {
        cout << "waaah2" << endl;
      }
      if (c2 < 0) {
        cout << "waaah3" << endl;
      }
      ans[i] = dist + 1.0 + val[y] + c2 / c1;
    }
  }
  std::cout << std::fixed;
  std::cout << std::setprecision(12);
  for (int i = 0; i < m; i++) {
    cout << ans[i] << endl;
  }
}
