There is a directed graph with vertices numbered from to and directed edges. You start at vertex and want to reach vertex . The graph is strongly connected.
For each , vertex has a height . For each , the -th directed edge has a start vertex , an end vertex , and a length . The time to traverse an edge from to is , where and are given constants.
You have a special item that can be used on at most edges. When used on an edge, the traversal time for that edge is divided by . That is, the time becomes , where is a given constant. You can also issue a secret command to change the height of at most one vertex to any real number. However, if your path passes through this vertex (i.e., it is an intermediate vertex on the path), the lengths of the edges immediately before and after it must be equal.
Find the minimum time required to reach vertex from vertex .
The first line of the input contains two integers and , representing the test case number and the number of test cases. For the samples, indicates that the sample has the same constraints as test case .
Then, for each test case:
The first line contains eight integers , representing the number of vertices, the number of edges, the starting vertex, the target vertex, the constant , the constant , the maximum number of times the special item can be used, and the acceleration constant .
The next line contains integers, the -th of which is , representing the current height of vertex .
The next lines each contain three integers , representing the start vertex, end vertex, and length of an edge.
For all test cases, .
It is guaranteed that for any vertex , there is at least one simple path from to .
For each test case, output a single floating-point number on a single line, representing the answer. If the given answer is and your answer is , your answer is considered correct if .
3 1
4 2 2 4 5 4 1 2
5 5 7 4
1 4 9
2 1 5
249.7777777778