#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v);
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) {
  return cout << "(" << p.first << ", " << p.second << ")";
}
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v) {
  cout << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
template <typename A, typename B>
istream &operator>>(istream &cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
mt19937 rng(steady_clock::now().time_since_epoch().count());
void usaco(string filename) {
#pragma message("be careful, freopen may be wrong")
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
const long double pi = 3.14159265358979323846;
const long long mod = 1000000007;
struct lca_lift {
  const int lg = 20;
  int n;
  vector<int> depth;
  vector<vector<int> > edges;
  vector<vector<int> > lift;
  void init(int sz) {
    n = sz;
    depth = vector<int>(n);
    edges = vector<vector<int> >(n, vector<int>());
    lift = vector<vector<int> >(n, vector<int>(lg, -1));
  }
  void edge(int a, int b) {
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  void attach(int node_to_attach, int node_to_attach_to) {
    int a = node_to_attach, b = node_to_attach_to;
    edge(a, b);
    lift[a][0] = b;
    for (int i = 1; i < lg; i++) {
      if (lift[a][i - 1] == -1)
        lift[a][i] = -1;
      else
        lift[a][i] = lift[lift[a][i - 1]][i - 1];
    }
    depth[a] = depth[b] + 1;
  }
  void init_lift(int v = 0) {
    depth[v] = 0;
    dfs(v, -1);
  }
  void dfs(int v, int par) {
    lift[v][0] = par;
    for (int i = 1; i < lg; i++) {
      if (lift[v][i - 1] == -1)
        lift[v][i] = -1;
      else
        lift[v][i] = lift[lift[v][i - 1]][i - 1];
    }
    for (int x : edges[v]) {
      if (x != par) {
        depth[x] = depth[v] + 1;
        dfs(x, v);
      }
    }
  }
  int get(int v, int k) {
    for (int i = lg - 1; i >= 0; i--) {
      if (v == -1) return v;
      if ((1 << i) <= k) {
        v = lift[v][i];
        k -= (1 << i);
      }
    }
    return v;
  }
  int get_lca(int a, int b) {
    if (depth[a] < depth[b]) swap(a, b);
    int d = depth[a] - depth[b];
    int v = get(a, d);
    if (v == b) {
      return v;
    } else {
      for (int i = lg - 1; i >= 0; i--) {
        if (lift[v][i] != lift[b][i]) {
          v = lift[v][i];
          b = lift[b][i];
        }
      }
      return lift[b][0];
    }
  }
};
long long n, m, k, q, Q, T, l, r, x, y, z;
long long a[1000005];
long long b[1000005];
long long c[1000005];
string second, t;
long long ans = 0;
vector<int> edges[100005];
map<int, long long> dp[100005];
long long tot[100005];
long long par[100005];
long long sz[100005];
lca_lift lca;
void dfs1(int v, int p = -1) {
  tot[v] = 1;
  sz[v] = 1;
  for (int x : edges[v])
    if (x != p) {
      dfs1(x, v);
      dp[v][x] = tot[x] + sz[x];
      tot[v] += tot[x] + sz[x];
      sz[v] += sz[x];
    }
}
void dfs2(int v, int p, long long run) {
  run += tot[v];
  for (int x : edges[v])
    if (x != p) {
      long long o = dp[v][x];
      run -= o;
      run += n - sz[x];
      dfs2(x, v, run);
      run -= n - sz[x];
      run += o;
    }
  run -= tot[v];
  par[v] = run;
}
long double solve(int x, int y, int v) {
  if (v != x) {
    return tot[x] - par[x];
  } else {
    int v2 = lca.get(y, lca.depth[y] - lca.depth[x] - 1);
    return tot[x] - dp[x][v2];
  }
}
long double gcnt(int x, int y, int v) {
  if (v != x) {
    return sz[x];
  } else {
    int v2 = lca.get(y, lca.depth[y] - lca.depth[x] - 1);
    return n - sz[v2];
  }
}
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  cin >> n >> m;
  lca.init(n);
  for (long long i = 0; i < n - 1; i++) {
    cin >> x >> y;
    lca.edge(--x, --y);
    edges[x].push_back(y);
    edges[y].push_back(x);
  }
  lca.init_lift(0);
  dfs1(0, -1);
  dfs2(0, -1, 0);
  for (long long i = 0; i < n; i++) tot[i] += par[i];
  cout << setprecision(13) << fixed;
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    --x;
    --y;
    int v = lca.get_lca(x, y);
    long double xy = gcnt(x, y, v), yx = gcnt(y, x, v);
    long double dist = (lca.depth[x] + lca.depth[y] - 2 * lca.depth[v]);
    long double res = (solve(x, y, v) * yx) + (solve(y, x, v) * xy);
    res /= xy * yx;
    res += dist - 1;
    cout << res << '\n';
  }
}
