#include <bits/stdc++.h>
using namespace std;
vector<long long> g[100007];
long long u[100007], k;
void dfs(long long x) {
  u[x] = 1;
  bool OK = false;
  for (long long i = 0; i < g[x].size(); i++)
    if (!u[g[x][i]]) {
      OK = true;
      dfs(g[x][i]);
    }
  if (!OK) k++;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, s, i, x, y, start = -1;
  cin >> n >> s;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    if (start < 0 && g[x].size() > 1) start = x;
    if (start < 0 && g[y].size() > 1) start = y;
  }
  if (start == -1) {
    cout << s;
    return 0;
  }
  dfs(start);
  cout << fixed << setprecision(7) << s / (long double)k * 2;
}
