#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) { return (!y ? x : gcd(y, x % y)); }
const int maxn = 1e6 + 10;
vector<int> adj[maxn];
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  long double s;
  cin >> s;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  if (n == 2) {
    cout << setprecision(15) << s << '\n';
    return 0;
  }
  long double cnt = 0;
  for (int i = 0; i < n; i++) {
    for (auto u : adj[i]) {
      if (adj[u].size() == 1 || adj[i].size() == 1) {
        if (i < u) cnt += 1.0;
      }
    }
  }
  cout << setprecision(15) << s / cnt * 2.0 << '\n';
}
