#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, s, res = 0;
vector<int> G[N];
int main() {
  ios ::sync_with_stdio(false);
  int i;
  cin >> n >> s;
  for (i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v), G[v].push_back(u);
  }
  for (i = 1; i <= n; ++i)
    if (G[i].size() == 1) ++res;
  cout << fixed << setprecision(12) << s * 2 / (res * 1.0) << '\n';
  return 0;
}
