#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, s, x, y;
vector<int> G[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  while (cin >> n >> s) {
    for (int i = 1; i <= n - 1; ++i) {
      cin >> x >> y;
      G[x].push_back(y);
      G[y].push_back(x);
    }
    int cnt = 0;
    for (int i = 1; i <= n; ++i)
      if (G[i].size() == 1) cnt++;
    cout << fixed << setprecision(7) << 2.0 * s / cnt << endl;
    for (int i = 0; i <= n; ++i) G[i].clear();
  }
  return 0;
}
