#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  cin >> n >> s;
  vector<vector<int>> G(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  if (n == 2) {
    cout << s << endl;
    return 0;
  }
  int cnt = 0;
  for (auto g : G) {
    if (g.size() == 1) cnt++;
  }
  double ans = 2.0 * s / cnt;
  cout << fixed << setprecision(32) << ans << endl;
  return 0;
}
