#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
void solve() {
  int n;
  double s;
  cin >> n >> s;
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    adj[(int)u].push_back(v);
    adj[(int)v].push_back(u);
  }
  if (n == 2) {
    cout << std::setprecision(9) << s;
    return;
  }
  double leaf = 0;
  for (int i = 0; i < n; i++) {
    if (adj[i + 1].size() == 1) leaf++;
  }
  double ans = (s / leaf) * 2.0;
  cout << std::setprecision(9) << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
