#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  long double s;
  cin >> n >> s;
  vector<long long> cnt(n);
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    --u;
    --v;
    ++cnt[u];
    ++cnt[v];
  }
  long long ans = 0;
  for (long long i = 0; i < n; ++i) ans += (cnt[i] == 1);
  cout << setprecision(20) << 2.0 * s / ans << endl;
  return 0;
}
