#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, s;
  scanf("%d%d", &n, &s);
  if (n == 2) {
    printf("%d\n", s);
    return 0;
  }
  vector<vector<int>> e(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  int sum = 0;
  for (auto x : e) {
    sum += x.size() == 1;
  }
  printf("%.8f\n", 2. * s / sum);
  return 0;
}
