Topic links Love working garlic and garlic
Time limit:1000ms Memory limit:262144k
problem Description
As we all know, garlic is a good job-loving staff, he thinks time is money, do things always race against the clock.
This evening, garlic and garlic went to dinner alone. Unfortunately, after dinner, it began to rain, garlic and garlic did not bring an umbrella out. But garlic and garlic love work, work makes him happy, he wants to hurry back to write code.
Garlic Company in Zhongguancun, Zhongguancun side of the complex topography, there are many bridges, underground passages and the road staggered together. Among them, underground passages can be sheltered from the rain, flyovers and roads are not able to avoid. Zhongguancun can be abstracted into a map of n points (vertex number 1 to n), which has M1 m_1 underground passage, there are M2 M_2 road or overpass, of which the length of the underground channel is 1. Garlic eating place at 1 O ', company at N Point. Of course, although garlic and garlic love work, but he does not want to rain a lot, but also do not want to waste a lot of time. So he had a compromise-he wanted to be in the rain and as little as possible in the case that the sum of the journeys he had taken back to the company was less than or equal to L.
Please help yourself to a job-loving garlic. Plan A path, don't let him waste time. Input
The first line enters the number of test groups T (1≤T≤20). The first line enters the number of test groups T (1 \le T \le 20).
Next T Group data. Next T Group data.
The first line of each set of data is entered in four integers n (2≤n≤100), M1 (0≤m1≤50), M2 (0≤m2≤5000), L (1≤l≤108). The first line of each set of data is entered in four integers n (2 \le n \le), m_1 (0 \le m_1 \le), m_2 (0 \le m_2 \le), L (1 \le L \le 10^8).
Next to the M1 line, enter two integers a, B (1≤a,b≤n) per line, indicating that A and B have a