PROBLEM DESCRIPTION
A family going on a vacation have a limited budget. They have to travel a country
starting from one city which is the source and ending at another city which is the
destination. There are 'n' cities in the country and 'm' roads connecting the cities. For
each of the roads connecting two cities , there is also an alternate path connecting
those two cities. This alternate route is the luxury train route. The money that is spent
via the normal route and the luxury train route between the two cities is given.
Now the family wants to reach their destination by spending the minimum amount
possible. Also they can have at most one luxury train ride in their journey. So as their
trip adviser you have to plan the trip such that cost is minimized.
Input format:
First line contains 't', the number of test cases. For each test case:
The first line contains 'n' and 'm' denoting the number of cities and number of roads
respectively.
The next 'm' lines contains four integers,'u','v','c1' and 'c2' ,where u and v are the cities
which are connected by normal route(whose cost to travel is 'c1') and the luxury train
route(whose cost is 'c2').
The last line contains tow integers denoting the source and the destination respectively.
Output format:
For each test case,output the minimum travel cost if the destination is reachable. If the
destination is not reachable from the source print -1.
Sample Input:
1
44
1 2 10 4
1379
2435
3434
14
Sample Output:
7