#include <bits/stdc++.h>
using namespace std;
int deg[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  long double s;
  cin >> s;
  cout << fixed << setprecision(10);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    cin >> a >> b;
    deg[a]++, deg[b]++;
  }
  long double cnt = 0;
  for (int i = 1; i <= n; i++)
    if (deg[i] == 1) cnt += 1.0;
  s /= cnt;
  s *= 2;
  cout << s;
  return 0;
}
