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