#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, deg[100005], num;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &l, &r);
    deg[l]++;
    deg[r]++;
  }
  for (int i = 1; i <= n; i++)
    if (deg[i] == 1) num++;
  printf("%.7f\n", (double)2.0 * m / num);
}
