#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
long long n, m, dp[N][19], down[N], edge[N], par[N], high[N], up[N];
vector<long long> adj[N];
void make_par(long long v, long long pr, long long h) {
  par[v] = pr;
  high[v] = h;
  for (long long i : adj[v])
    if (i != pr) {
      make_par(i, v, h + 1);
      down[v] += down[i];
      edge[v] += edge[i] + down[i];
    }
  down[v]++;
}
void make_it(long long v, long long pr) {
  for (long long i : adj[v])
    if (i != pr) {
      up[i] = edge[v] - edge[i] - down[i] + up[v] + n - down[i];
      make_it(i, v);
    }
}
long long go_up(long long v, long long dis) {
  if (!dis) return v;
  for (long long i = 19; i >= 0; i--)
    if (dis & (1LL << i)) return go_up(dp[v][i], dis ^ (1LL << i));
}
long long LCA(long long v, long long u) {
  if (high[v] < high[u])
    u = go_up(u, high[u] - high[v]);
  else if (high[v] > high[u])
    v = go_up(v, high[v] - high[u]);
  if (v == u) return v;
  long long st = 0, ed = n;
  while (ed - st > 1) {
    long long mid = (st + ed) / 2;
    if (go_up(v, mid) == go_up(u, mid))
      ed = mid;
    else
      st = mid;
  }
  return go_up(v, ed);
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  cin >> n >> m;
  for (long long i = 1; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  make_par(0, 0, 0);
  make_it(0, 0);
  for (long long i = 0; i < n; i++) dp[i][0] = par[i];
  for (long long j = 1; j < 19; j++)
    for (long long i = 0; i < n; i++) dp[i][j] = dp[dp[i][j - 1]][j - 1];
  for (long long i = 0; i < m; i++) {
    long long v, u, w;
    cin >> v >> u;
    v--;
    u--;
    w = LCA(v, u);
    if (w == v || w == u) {
      if (high[v] > high[u]) swap(u, v);
      long long tmp = go_up(u, high[u] - high[v] - 1), dw = n - down[tmp],
                ew = up[v] + edge[v] - edge[tmp] - down[tmp];
      long long ans = dw * edge[u] + down[u] * ew +
                      (high[v] + high[u] - 2 * high[v] + 1) * down[u] * dw;
      long double res = (long double)ans / (long double)(down[u] * dw);
      cout << fixed << setprecision(6) << res << endl;
    } else {
      long long ans = down[v] * edge[u] + down[u] * edge[v] +
                      (high[u] + high[v] - 2 * high[w] + 1) * down[u] * down[v];
      long double res = (long double)ans / (long double)(down[v] * down[u]);
      cout << fixed << setprecision(6) << res << endl;
    }
  }
}
