#include <bits/stdc++.h>
using namespace std;
vector<long long> g[100005];
void solve() {
  long long n;
  double s;
  cin >> n >> s;
  for (long long i = 0, u, v; i < n - 1; ++i) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long leaves = 0;
  for (long long i = 1; i <= n; ++i) {
    leaves += g[i].size() == 1;
  }
  cout << setprecision(18) << 2 * s / leaves << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T = 1;
  for (long long i = 1; i <= T; ++i) {
    solve();
  }
  return 0;
}
