#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7;
vector<long long> adj[N];
long long t[N][20], sz[N], sum[N], lvl[N], s[N];
void dfs(long long v, long long p) {
  t[v][0] = p;
  for (long long i = 1; i < 20; i++) {
    t[v][i] = t[t[v][i - 1]][i - 1];
  }
  sz[v] = 1;
  lvl[v] = lvl[p] + 1;
  sum[v] = lvl[v];
  for (long long u : adj[v])
    if (u ^ p) {
      dfs(u, v);
      sz[v] += sz[u];
      sum[v] += sum[u];
    }
}
void dfs(long long v, long long p, long long ss) {
  s[v] = ss;
  for (long long u : adj[v])
    if (p ^ u) {
      dfs(u, v, ss + sz[1] - 2 * sz[u]);
    }
}
long long pull(long long v, long long l) {
  for (long long i = 19; i >= 0; i--)
    if (lvl[v] - (1 << i) >= l) {
      v = t[v][i];
    }
  return v;
}
long long lca(long long u, long long v) {
  if (lvl[u] > lvl[v]) {
    swap(u, v);
  }
  v = pull(v, lvl[u]);
  if (u == v) {
    return v;
  }
  for (long long i = 19; i >= 0; i--)
    if (t[v][i] != t[u][i]) {
      u = t[u][i];
      v = t[v][i];
    }
  return t[v][0];
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  dfs(1, 0, sum[1]);
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    cin >> u >> v;
    if (lvl[u] > lvl[v]) {
      swap(u, v);
    }
    long long l = lca(u, v);
    if (l == u) {
      long long x = pull(v, lvl[u] + 1);
      long long sx = sum[x] - sz[x] * (lvl[x] - 2);
      long long szx = n - sz[x], smx = s[u] - sx;
      long long p =
          sz[v] * (smx - szx) + szx * (sum[v] - sz[v] * lvl[l]) + sz[v] * szx;
      cout << fixed << setprecision(10) << (double)p / (double)(sz[v] * szx)
           << endl;
    } else {
      long long p = sz[u] * (sum[v] - sz[v] * lvl[l]) +
                    sz[v] * (sum[u] - sz[u] * lvl[l]) + sz[u] * sz[v];
      cout << fixed << setprecision(10) << (double)p / (double)(sz[u] * sz[v])
           << endl;
    }
  }
}
