Tony Stark 在玩游戏。在一个 个点的树上,Tony Stark 放置了 个鸡贼。每个鸡贼有四个整数参数 ,表示这个鸡贼会在 时刻出现在点 ,并以每时刻 条边的速度向 点匀速移动,到达 点时立刻消失。
如果一个时刻有两个鸡贼在同一位置,它们会立刻爆炸。
(注意,如果一个鸡贼的 那么它会在 时刻出现,此时如果这个点有其它鸡贼一样会发生爆炸)
Tony Stark 想知道最早有鸡贼爆炸的时刻。如果自始至终都没发生爆炸输出 -1
。
如果你的答案和标准答案的绝对或相对误差不超过 那么被视为正确。
Tony Stark is playing a game with his suits (they have auto-pilot now). He lives in Malibu. Malibu has junctions numbered from to , connected with roads. One can get from a junction to any other junction using these roads (graph of Malibu forms a tree).
Tony has suits. There's a special plan for each suit. The -th suit will appear at the moment of time in the junction , and will move to junction using the shortest path between and with the speed roads per second (passing a junctions takes no time), and vanishing immediately when arriving at (if it reaches in time , it's available there at moment , but not in further moments). Also, suits move continuously (for example if , at time it's in the middle of a road. Please note that if it means the suit will be at junction number only at moment and then it vanishes.
An explosion happens if at any moment of time two suits share the same exact location (it may be in a junction or somewhere on a road; while appearing, vanishing or moving).
Your task is to tell Tony the moment of the the first explosion (if there will be any).
The first line of the input contains two integers and () — the number of junctions and the number of suits respectively.
The next lines contain the roads descriptions. Each line contains two integers and — endpoints of the -th road (, ).
The next lines contain the suit descriptions. The -th of them contains four integers , , and (, ), meaning the -th suit will appear at moment of time at the junction and will move to the junction with a speed roads per second.
If there would be no explosions at all, print -1 in the first and only line of output.
Otherwise print the moment of the first explosion.
Your answer will be considered correct if its relative or absolute error doesn't exceed .
6 4
2 5
6 5
3 6
4 6
4 1
27 6 1 3
9 5 1 6
27 4 3 4
11 29 2 6
27.3
6 4
3 1
4 5
6 4
6 1
2 6
16 4 4 5
13 20 6 2
3 16 4 5
28 5 3 5
-1