#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 100;
long double k = 0;
vector<long long> g[N];
void DFS(long long v, long long pr) {
  if (g[v].size() == 1) {
    k++;
    return;
  }
  for (auto to : g[v]) {
    if (to == pr) continue;
    DFS(to, v);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long double s;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  if (n == 2) {
    cout << s;
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    if (g[i].size() > 1) {
      DFS(i, i);
      break;
    }
  }
  cout << fixed << setprecision(10) << s * 2 / k;
}
