#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double m;
  int freq[100100] = {0};
  cin >> n >> m;
  if (n == 2) {
    cout << m << endl;
    return 0;
  }
  double cont = 0;
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    freq[x]++;
    freq[y]++;
    if (freq[y] == 1) {
      cont++;
    } else if (freq[y] == 2) {
      cont--;
    }
    if (freq[x] == 1) {
      cont++;
    } else if (freq[x] == 2) {
      cont--;
    }
  }
  double ans = 2.0 * m / cont;
  printf("%.8f\n", ans);
}
