#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 100;
template <class nmsl>
inline void read(nmsl &x) {
  x = 0;
  char ch = getchar(), w = 0;
  while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  x = w ? -x : x;
}
int n, rudu[N], s, cnt;
int main() {
  read(n), read(s);
  for (register int i = 1, qa; i < n; i++)
    read(qa), rudu[qa]++, read(qa), rudu[qa]++;
  for (register int i = 1; i <= n; i++) cnt += (rudu[i] == 1);
  printf("%0.9lf\n", 2.0 * s / cnt);
  return 0;
}
