#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
std::vector<long long int> v[(long long int)1e6];
long long int mark[(long long int)1e6], ans = 0;
long long int check(long long int in) {
  if (((long long int)v[in].size()) == 1)
    return 1;
  else
    return 0;
}
void dfs(long long int in) {
  long long int i, j;
  mark[in] = 1;
  for (auto x : v[in]) {
    if (!mark[x]) {
      dfs(x);
      if (check(in) || check(x)) ans++;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int test = 1;
  while (test--) {
    long long int n, s, i, j;
    cin >> n >> s;
    for (i = 0; i < n - 1; i++) {
      long long int x, y;
      cin >> x >> y;
      v[x].push_back(y);
      v[y].push_back(x);
    }
    dfs(1);
    cout << fixed << setprecision(10);
    if (ans == 1)
      cout << s;
    else
      cout << 2.0 * s / ans;
  }
  cerr << "Time Taken:" << (float)clock() / CLOCKS_PER_SEC * 1000 << "ms"
       << "\n";
  return 0;
}
