#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[100005];
double work() {
  if (n == 2) return 1.0;
  int cnt = 0;
  for (int i = 1; i <= (n); i++)
    if (adj[i].size() == 1) cnt++;
  return 2.0 / cnt;
}
int main() {
  int s;
  scanf("%d%d", &n, &s);
  for (int _ = 0; _ < (n - 1); _++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  printf("%.12f", s * work());
  return 0;
}
