#include <bits/stdc++.h>
using namespace std;
void func() {
  long long n, s;
  cin >> n >> s;
  vector<long long> adj[n + 1];
  for (long long i = 0; i < n - 1; ++i) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long cnt = 0;
  for (long long i = 1; i < n + 1; ++i) {
    if (adj[i].size() == 1) {
      ++cnt;
    }
  }
  double ans = (cnt - 1) * s;
  ans = ans / (cnt * (cnt - 1) / 2);
  printf("%0.9lf\n", ans);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    func();
  }
}
