#include <bits/stdc++.h>
using namespace std;
int deg[100000];
int n;
double s;
int main() {
  scanf("%d %lf", &n, &s);
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    deg[a]++;
    deg[b]++;
    if (deg[a] == 1) cnt++;
    if (deg[a] == 2) cnt--;
    if (deg[b] == 1) cnt++;
    if (deg[b] == 2) cnt--;
  }
  printf("%.12lf\n", s / cnt * 2);
  return 0;
}
