#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return (!y ? x : gcd(y, x % y)); }
const long long MAXN = 3e5 + 3;
long long n, s, ans;
long long d[MAXN];
void MAIN() {
  cin >> n >> s;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    d[u]++;
    d[v]++;
  }
  for (long long i = 1; i <= n; i++) ans += d[i] == 1;
  cout << fixed << setprecision(15) << (long double)s / ans * 2;
}
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0);
  long long t;
  t = 1;
  while (t--) MAIN();
}
