#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
using namespace std;
const int DEBUG = 0;
mt19937 gen(
    (unsigned)chrono::high_resolution_clock::now().time_since_epoch().count());
#pragma comment(linker, "/STACK:67108864")
vector<int> g[100000];
int lvs;
void dfs(int v, int p = -1) {
  if (g[v].size() - (p != -1) == 0) lvs++;
  for (int to : g[v])
    if (to != p) dfs(to, v);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(cout.fixed);
  cout.precision(8);
  int n, sum;
  cin >> n >> sum;
  for (int i = 0; i < n - 1; i++) {
    int s, e;
    cin >> s >> e;
    g[--s].push_back(--e);
    g[e].push_back(s);
  }
  int ok = 0;
  for (int i = 0; i < n; i++)
    if (g[i].size() > 1) {
      dfs(i);
      ok = 1;
      break;
    }
  if (!ok)
    cout << sum;
  else
    cout << 2.0 * sum / lvs;
  return 0;
}
