#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long N, Count = 0;
  long double S;
  cin >> N >> S;
  vector<long> A(N + 2, 0);
  for (long i = 1, u, v; i < N; ++i) {
    cin >> u >> v;
    ++A[u];
    ++A[v];
  }
  for (long i = 1; i <= N; ++i)
    if (A[i] == 1) ++Count;
  cout << fixed << setprecision(18) << 2 * S / Count;
  return 0;
}
