SP1472 TOMJERRY - Tom and Jerry
Description
You may know the great American cartoon called _Tom and Jerry_. In that cartoon, Tom is a stupid cat, and Jerry is a cute mouse. They are all living in Blue Mary's house. (Maybe the name of the owner of the house they living in is not Blue Mary, but this is not important. ^\_^)
One day Jerry gets a GPS, so after that he can detect Tom's position accurately. He decides to play tricks on Tom again. The house has N (1
Input Format
Multiple test cases, the number of them is given in the very first line.
For each test case:
The first line contains two space-separated integers N and E. The second line contains two space-separated integers P and Q. E lines then follow, each contains 2 space-separated integers A and B which shows that there is a corridor between room A and room B.
Output Format
For each test case:
Output one line, which contains a single real number - the expected time unit, rounded to 3 decimal places.