#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
long long deg[123456];
long long N, S, i, s, e;
long long cnt;
long double ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> N >> S;
  for (i = 1; i < N; i++) {
    cin >> s >> e;
    deg[s - 1]++;
    deg[e - 1]++;
  }
  for (i = 0; i < N; i++)
    if (deg[i] == 1) cnt++;
  ans = (long double)S * (long double)2 / (long double)cnt;
  cout << fixed << setprecision(20) << ans << endl;
  return 0;
}
