#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj;
int nl = 0;
int vis[100010];
int dfs(int s) {
  vis[s] = 1;
  int cnt = 0;
  for (auto v : adj[s])
    if (!vis[v]) {
      dfs(v);
      cnt++;
    }
  if (cnt > 0)
    return cnt;
  else
    nl++;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, s;
  cin >> n >> s;
  memset(vis, 0, sizeof vis);
  adj.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  if (dfs(0) == 1) nl++;
  cout << fixed << setprecision(18);
  cout << (((long double)2) * s) / nl << endl;
  return 0;
}
