#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long id, mx = 0, ct = 0;
long long dg[200009];
vector<long long> v[200009];
void dfs(long long k, long long fr) {
  if (k != id && v[k].size() == 1) {
    ct++;
    return;
  }
  for (long long x : v[k]) {
    if (x == fr) continue;
    dfs(x, k);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, s;
  cin >> n >> s;
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    dg[x]++;
    dg[y]++;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (long long i = 1; i <= n; i++) {
    if (dg[i] > mx) {
      mx = dg[i];
      id = i;
    }
  }
  dfs(id, 0);
  if (v[id].size() == 1) ct++;
  double as = (s * 1.0 * 2.0) / (ct * 1.0);
  cout.precision(10);
  cout << fixed << as << endl;
}
