You are given a tree (an undirected connected graph without cycles) and an integer $s$.

Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is $s$. At the same time, he wants to make the diameter of the tree as small as possible.

Let's define the diameter of a weighed tree as the maximum sum of the weights of the edges lying on the path between two some vertices of the tree. In other words, the diameter of a weighed tree is the length of the longest simple path in the tree, where length of a path is equal to the sum of weights over all edges in the path.

Find the minimum possible diameter that Vanya can get.


-----Input-----

The first line contains two integer numbers $n$ and $s$ ($2 \leq n \leq 10^5$, $1 \leq s \leq 10^9$) — the number of vertices in the tree and the sum of edge weights.

Each of the following $n−1$ lines contains two space-separated integer numbers $a_i$ and $b_i$ ($1 \leq a_i, b_i \leq n$, $a_i \neq b_i$) — the indexes of vertices connected by an edge. The edges are undirected.

It is guaranteed that the given edges form a tree.


-----Output-----

Print the minimum diameter of the tree that Vanya can get by placing some non-negative real weights on its edges with the sum equal to $s$.

Your answer will be considered correct if its absolute or relative error does not exceed $10^{-6}$.

Formally, let your answer be $a$, and the jury's answer be $b$. Your answer is considered correct if $\frac {|a-b|} {max(1, b)} \leq 10^{-6}$.


-----Examples-----
Input
4 3
1 2
1 3
1 4

Output
2.000000000000000000
Input
6 1
2 1
2 3
2 5
5 4
5 6

Output
0.500000000000000000
Input
5 5
1 2
2 3
3 4
3 5

Output
3.333333333333333333


-----Note-----

In the first example it is necessary to put weights like this: [Image] 

It is easy to see that the diameter of this tree is $2$. It can be proved that it is the minimum possible diameter.

In the second example it is necessary to put weights like this: [Image]

Difficulty: interview

Starter code:

Solutions:
inp1 = input()
is1 = inp1.split(" ")
nodeCount = int(is1[0])
sum = float(is1[1])
nodes = [0 for x in range(nodeCount)]
inp2 = []
for z in range(nodeCount-1):
    inp2.append(input())
for reb in inp2:
    rebs = reb.split(" ")
    i = int(rebs[0])-1
    nodes[i] = nodes[i]+1
    i = int(rebs[1])-1
    nodes[i] = nodes[i]+1
nodes = [x for x in nodes if x == 1]
print(sum*2/len(nodes))


n, s = map(int, input().split())
a = [0] * (n + 1)
kol = 0
for i in range(n - 1):
    x, y = map(int, input().split())
    a[x] += 1
    a[y] += 1
for i in range(1, n + 1):
    if a[i] == 1:
        kol += 1
print(s / kol * 2)

n,s = map(int,input().split())
c = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int,input().split())
    c[a-1].append(b)
    c[b-1].append(a)
d = set()
k = 0
for i in range(n):
    if len(c[i]) == 1:
        d.add(i)
        if not (c[i][0] - 1) in d:
            k += 1
if n == 2:
    print(s)
else:
    print(round(s * 2 / k,7))

n, s = map(int, input().split())
mass = [0] * n
for i in range(n - 1):
    a1, b1 = map(int, input().split())
    a1 -= 1
    b1 -= 1
    mass[a1] += 1
    mass[b1] += 1
cnt = 0
for i in mass:
    cnt += (i == 1)
print(2 *s / cnt)

n, s = list(map(int, input().split()))
a = [0 for i in range(n)]
for i in range(n-1):
    x, y = list(map(int, input().split()))
    a[x-1]+=1
    a[y-1]+=1
counter = 0
for i in a:
    if (i==1):
        counter+=1
print((2*s)/counter)
    


# list(map(int, input().split()))
n, s = list(map(int, input().split()))
ss = [[] for i in range(n)]
vis = [0] * n
#print(vis)
for i in range(n - 1):
    a, b = list(map(int, input().split()))
    ss[a - 1].append(b - 1)
    ss[b - 1].append(a - 1)

li = 0
#print(ss)


for i in range(n):
    if len(ss[i]) == 1:
        li += 1
print(s / li * 2)


n, s = map(int, input().split())
a = [0] * n
if n == 2:
    xc, xd = map(int, input().split())
    print(s)
    return
for i in range(n - 1):
    xc, xd = map(int, input().split())
    a[xd - 1] += 1
    a[xc - 1] += 1
cnt = 0
for i in range(n):
    if a[i] == 1:
        cnt += 1
print(2 * round(s / cnt, 10))

n, s = list(map(int, input().split()))
a = [0] * n
listy = 0
for i in range(n - 1):
    c, d = list(map(int, input().split()))
    a[c-1] += 1
    a[d-1] += 1
    if a[c-1] == 1:
        listy += 1
    if a[c-1] == 2:
        listy -= 1
    if a[d-1] == 1:
        listy += 1
    if a[d-1] == 2:
        listy -= 1 
if n <= 3:
    print(s)
else:
    print(float(s) * 2 / float(listy))

def main():
    n, s = list(map(int, input().split()))

    g = [0 for _ in range(n)]
    for _ in range(n - 1):
        a, b = list(map(int, input().split()))
        a -= 1
        b -= 1
        g[a] += 1
        g[b] += 1

    m = 0
    for x in g:
        if x == 1:
            m += 1

    print(2 * s / m)


main()


koor = dict()
a = input()
q = int(a.split()[0])
w = int(a.split()[1])
for i in range(q - 1):
    a = input()
    z = int(a.split()[0])
    x = int(a.split()[1])    
    if z not in list(koor.keys()):
        koor[z] = 1
    else:
        koor[z] += 1
    if x not in list(koor.keys()):
        koor[x] = 1
    else:
        koor[x] += 1
tt = list()
kolvo = 0
for i in list(koor.values()):
    if i == 1:
        kolvo += 1
print((w * 2) / kolvo)


# list(map(int, input().split()))
# map(int, input().split())

n, s = map(int, input().split())
g = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

cnt = 0
for i in range(n):
    if len(g[i]) == 1:
        cnt += 1
print(2 * s / cnt)

a, s = list(map(int, input().split()))
graph = [[] for _ in range(a)]
for _ in range(a - 1):
    x, y = list(map(int, input().split()))
    graph[x-1].append(y-1)
    graph[y-1].append(x-1)
k = 0
for i in graph:
    if len(i) == 1:
        k += 1
print((s*2) / k)


n,s = [int(i) for i in input().split()]
lst = [0 for i in range(n)]
for i in range(n-1):    
    x,y = [int(i) for i in input().split()]
    lst[x-1]+=1
    lst[y-1]+=1
count = 0
for i in lst:
    if i == 1:
        count+=1

print(2*s/count)


n, s = list(map(int, input().split()))
tree = [[] for i in range(n)]
for i in range(n-1):
    inp = list([int(x)-1 for x in input().split()])
    tree[inp[0]].append(inp[1])
    tree[inp[1]].append(inp[0])
cou = 0
for i in tree:
    if len(i) == 1:
        cou+=1
print(s/cou*2)


import sys, time, os
from pprint import pprint as pp
if os.environ.get('_ONPC_', False):
    stdin = open('input.txt', 'r')
    stdout = open('output.txt', 'w')
    sys.stdin = stdin
    sys.stdout = stdout

    now = time.time()
    __flag = True
else:
    __flag = False


def what(obj):
    if __flag:
        pp(obj, sys.stderr)


#############################################
from collections import deque
n, s = map(int, input().split())

d = {}

for i in range(n-1):
    a, b = map(int, input().split())
    if a not in d:
        d[a] = 1
    else:
        d[a] += 1
    if b not in d:
        d[b] = 1
    else:
        d[b] += 1

cnt = 0
for e in d:
    if d[e] == 1:
        cnt += 1

print(2*s/cnt)

##############################################
if __flag:
    stdout.close()
    stdin.close()

    print(time.time() - now, file=sys.stderr)


n, s = map(int, input().split())
d = {}
max_vert = 1
for i in range(n - 1):
    vertex = list(map(int, input().split()))
    d[vertex[0]] = d.get(vertex[0], 0) + 1
    d[vertex[1]] = d.get(vertex[1], 0) + 1
cnt = 0
for i in d:
    if d[i] == 1:
        cnt += 1
m = max(d.values())
c = 0
for i in d:
    if d[i] == 1:
        c += 1
print(2 * s / c)

n,s = map(int, input().split())
ans = {}
for i in range(n-1):
    a,b = map(int, input().split())
    if a in ans:
        ans[a].append(b)
    else:
        ans[a] = [b,]
    if b in ans:
        ans[b].append(b)
    else:
        ans[b] = [a,]

max_count = 0
for key in ans:
    if len(ans[key]) == 1:
        max_count += 1

if n ==2 :
    print(s)
else:
    print(s/(max_count)*2)

#!/usr/bin/env python
# coding: utf-8

# In[ ]:


n, s=list(map(int, input().split()))


# In[ ]:


edgecount=[0 for i in range(n)]


# In[ ]:


for j in range(0,n-1):
    e1, e2=list(map(int, input().split()))
    edgecount[e1-1]+=1
    edgecount[e2-1]+=1
    
    
nodecount=0

for i in range(0,n):
    if edgecount[i]==1:
        nodecount+=1

print(s*2/nodecount)
    



n,s = [int(item) for item in input().split()]
g = [0 for i in range(n+10)]
for i in range(n-1):
    u,v  = [int(item) for item in input().split()]
    g[u] += 1
    g[v] += 1 
c = 0
for i in range(1, n+1):
    if (g[i] == 1):
        c += 1
print(2*s/c)

n, s = map(int, input().split())
d = {}
for i in range(n - 1):
    vertex = list(map(int, input().split()))
    d[vertex[0]] = d.get(vertex[0], 0) + 1
    d[vertex[1]] = d.get(vertex[1], 0) + 1
c = 0
for i in d:
    if d[i] == 1: c += 1
print(2 * s / c)

n, s = map(int, input().split())
d = {}
max_vert = 1
for i in range(n - 1):
    vertex = list(map(int, input().split()))
    d[vertex[0]] = d.get(vertex[0], 0) + 1
    d[vertex[1]] = d.get(vertex[1], 0) + 1
cnt = 0
for i in d:
    if d[i] == 1:
        cnt += 1
m = max(d.values())
c = 0
for i in d:
    if d[i] == 1:
        c += 1
print(2 * s / c)

n, s = map(int, input().split())
d = {}
max_vert = 1
for i in range(n - 1):
    vertex = list(map(int, input().split()))
    d[vertex[0]] = d.get(vertex[0], 0) + 1
    d[vertex[1]] = d.get(vertex[1], 0) + 1
cnt = 3
for i in d:
    if d[i] == 1:
        cnt += 1
m = max(d.values())
c = 0
for i in d:
    if d[i] == 1:
        c += 1
print(2 * s / c)

n, s = map(int, input().split())
d = {}
max_vert = 1
for i in range(n - 1):
    vertex = list(map(int, input().split()))
    d[vertex[0]] = d.get(vertex[0], 0) + 1
    d[vertex[1]] = d.get(vertex[1], 0) + 1
cnt = 1
for i in d:
    if d[i] == 1:
        cnt += 1
m = max(d.values())
c = 0
for i in d:
    if d[i] == 1:
        c += 1
print(2 * s / c)