#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
ll n, s;
int main() {
  cout.precision(70);
  cin >> n >> s;
  if (n == 2) {
    cout << (ld)s << "\n";
    return 0;
  } else if (n == 2) {
    cout << (ld)s << "\n";
    return 0;
  }
  vector<ll> cnt(n + 1, 0LL);
  for (ll i = 0; i < n - 1; i++) {
    ll a, b;
    cin >> a >> b;
    cnt[a]++;
    cnt[b]++;
  }
  ll leaf = 0;
  for (auto &el : cnt) {
    if (el == 1) leaf++;
  }
  cout << (((ld)2.0) * (ld)s / (ld)leaf) << "\n";
  return 0;
}
