#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int deg[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, s;
  cin >> n >> s;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    deg[u]++;
    deg[v]++;
  }
  int l = 0;
  for (int u = 1; u <= n; u++) {
    if (deg[u] == 1) {
      l++;
    }
  }
  double ans = ((2.0 * s) / l);
  cout << setprecision(10) << fixed << ans << endl;
  return 0;
}
