#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long int INF = 1000111000111000111LL;
const long long int MAX = 1e5 + 5;
const long double PI = 3.1415926536;
std::vector<long long int> g[MAX];
int32_t main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  long double s;
  cin >> n >> s;
  for (long long int ii = 0; ii < n - 1; ii++) {
    long long int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= n; i++) {
    if ((long long int)((g[i]).size()) == 1) cnt++;
  }
  cout << fixed << setprecision(9) << (long double)2 * s / cnt;
  return 0;
}
