#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 7;
const long long inf = 1e18 + 1;
const long long mod = 998244353;
const double eps = 1e-8;
int n, s, tot;
int head[N];
struct node {
  double val;
  int v, nxt;
  node() { val = 0; }
};
node e[2 * N];
void add(int u, int v) {
  e[++tot].v = v;
  e[tot].nxt = head[u];
  head[u] = tot;
}
int count(int x) {
  int res = 0;
  for (x = head[x]; x; x = e[x].nxt) {
    res++;
    if (res >= 2) break;
  }
  return res;
}
void addval(int& x, const double& val) {
  int tot = head[x];
  e[tot].val += val;
  e[tot ^ 1].val += val;
}
int p;
double ans, d[N];
void dfs(int x, int fa) {
  if (ans < d[x]) {
    ans = d[x];
    p = x;
  }
  for (int xx = head[x]; xx; xx = e[xx].nxt) {
    int y = e[xx].v;
    if (y == fa) continue;
    d[y] = e[xx].val + d[x];
    dfs(y, x);
  }
}
void find(int x) {
  ans = 0;
  d[x] = 0;
  dfs(x, 0);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> s;
  tot = 1;
  for (int i = 1, u = 1, v = 1; i <= n - 1; i++) {
    cin >> u >> v;
    add(u, v);
    add(v, u);
  }
  vector<int> leaf;
  for (int i = 1; i <= n; i++) {
    if (count(i) == 1) leaf.push_back(i);
  }
  double val = s * 1.0 / leaf.size();
  for (auto& v : leaf) {
    addval(v, val);
  }
  p = 0;
  find(1);
  find(p);
  printf("%.16lf\n", ans);
  return 0;
}
