#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pii = pair<int, int>;
using Vi = vector<int>;
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  run();
  return 0;
}
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
void run() {
  int n, s;
  cin >> n >> s;
  vector<Vi> G(n);
  for (int i = (1); i < (n); i++) {
    int a, b;
    cin >> a >> b;
    G[a - 1].push_back(b - 1);
    G[b - 1].push_back(a - 1);
  }
  if (n == 2) {
    cout << s << endl;
    return;
  }
  int leaves = 0;
  for (auto& v : (G)) leaves += (int((v).size()) == 1);
  cout << (double(s) / double(leaves) * 2) << endl;
}
