#include <bits/stdc++.h>
using namespace std;
int n, s, d;
vector<int> adj[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (adj[i].size() == 1) d++;
  cout << fixed << setprecision(10) << 2 * (long double)s / d << '\n';
  return 0;
}
