#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
const int N = 2e5 + 100;
int deg[N];
int n, m;
int main() {
  ios::sync_with_stdio(false);
  ;
  cin >> n >> m;
  if (n == 2) {
    cout << m << endl;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    deg[a]++, deg[b]++;
  }
  int r = 0;
  for (int i = 1; i <= n; i++)
    if (deg[i] == 1) r++;
  r = min(r, n - 1);
  cout << fixed << setprecision(10);
  cout << 2.0 * m / (double)r << endl;
}
