#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.2")
using namespace std;
inline void opting() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
}
long long inp() {
  long long x;
  cin >> x;
  return x;
}
void make_unique(vector<long long> &vec, bool sorted = false) {
  if (!sorted) sort((vec).begin(), (vec).end());
  vec.resize(unique((vec).begin(), (vec).end()) - vec.begin());
}
void file_edit(bool reader = true, bool writer = false) {
  if (reader) freopen("Test_input.txt", "r", stdin);
  if (writer) freopen("Test_output.txt", "w", stdout);
}
struct vertex {
  long long S;
  long long P;
  long long st, en;
  long long H = 0;
  long long upper;
};
const long long SQRT = 65, lg = 18 + 2, inlim = 2147483647, B = 48;
const long long maxn = 2e5 + 20, delta = 95542721, inf = 1e9 + 420;
vertex node[maxn];
vector<long long> adj[maxn];
long long par[lg][maxn];
long long tim = 0, n, q;
inline void add_edge(long long u, long long v) {
  adj[u].push_back(v);
  adj[v].push_back(u);
}
inline void input() {
  cin >> n >> q;
  for (long long i = 0; i < n - 1; i++) add_edge(inp() - 1, inp() - 1);
}
void DFS(long long v, long long p) {
  par[0][v] = p;
  node[v].S = 1;
  node[v].st = tim++;
  for (auto u : adj[v])
    if (u != p) {
      node[u].H = node[v].H + 1;
      DFS(u, v);
      node[v].S += node[u].S;
      node[v].P += node[u].S + node[u].P;
    }
  node[v].en = tim;
}
void up_calculation(long long v, long long p) {
  for (auto u : adj[v])
    if (u != p) {
      long long oth = n - node[v].S;
      node[u].upper =
          (node[v].upper + oth) +
          (node[v].P - (node[u].P + node[u].S) + node[v].S - node[u].S);
      up_calculation(u, v);
    }
}
inline void find_parents() {
  for (long long i = 1; i < lg; i++)
    for (long long v = 0; v < n; v++) par[i][v] = par[i - 1][par[i - 1][v]];
}
inline bool is_ancestor(long long candi, long long key) {
  return (node[candi].st <= node[key].st and node[key].en <= node[candi].en);
}
inline long long LCA(long long u, long long v, long long want_before = false) {
  if (node[u].H < node[v].H) swap(u, v);
  for (long long i = lg - 1; i > -1; i--)
    if (!is_ancestor(par[i][u], v)) {
      u = par[i][u];
    }
  if (want_before) return u;
  return par[0][u];
}
inline pair<long long, long long> Alpha(long long A, long long B) {
  long long z = LCA(A, B);
  long long dis = node[A].H + node[B].H - 2 * node[z].H;
  long long num = node[A].P * node[B].S + node[B].P * node[A].S;
  long long denum = node[A].S * node[B].S;
  return make_pair(dis * denum + num, denum);
}
inline pair<long long, long long> Beta(long long A, long long B) {
  long long z = LCA(A, B, 1);
  long long dis = node[B].H - node[A].H;
  long long Sz = n - node[z].S;
  long long Px = node[A].upper + node[A].P - node[z].P - node[z].S;
  long long num = node[B].P * Sz + Px * node[B].S;
  long long denum = node[B].S * Sz;
  return make_pair(dis * denum + num, denum);
}
inline pair<long long, long long> solve_quer(long long A, long long B) {
  if (node[A].H > node[B].H) swap(A, B);
  if (is_ancestor(A, B)) return Beta(A, B);
  return Alpha(A, B);
}
inline void output_fraction(pair<long double, long double> F) {
  long double ans = 1.0 + (long double)(0.0 + F.first / F.second);
  cout << fixed << setprecision(8) << ans << '\n';
  return;
  cout << F.first << endl << "------------" << endl << F.second << endl << endl;
}
void solve() {
  while (q--) output_fraction(solve_quer(inp() - 1, inp() - 1));
}
void predo() {
  DFS(0, 0);
  up_calculation(0, 0);
  find_parents();
}
void debug_A() {
  for (long long i = 0; i < n; i++) {
    cout << i + 1 << ' ' << 1 + par[0][i] << ' ' << node[i].S << ' '
         << node[i].P << ' ' << node[i].upper << ' ' << node[i].st << ' '
         << node[i].en << ' ' << node[i].H << endl;
  }
  cout << endl;
}
void debug_B() {
  while (1) {
    long long a, b;
    cin >> a >> b;
    cout << is_ancestor(a - 1, b - 1) << endl;
  }
}
int main() {
  opting();
  input();
  predo();
  solve();
}
