PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#FW0000109. Thoát khỏi cảnh sát (Speedy Escape)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Thoát khỏi cảnh sát (Speedy Escape)

Speedy Escape

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

Two brothers start at intersection bb while a police car starts at pp. All roads are bidirectional with lengths measured in units of 100 meters. The police car can travel at up to 160160 km/h and change speed/direction at will. Both parties depart simultaneously. Find the minimum maximum speed that allows the brothers to follow a fixed route to a highway exit without any possible collision, including collisions inside roads. If impossible, print IMPOSSIBLE.

Input

First line n,m,en,m,e, then mm roads u,v,lu,v,l, then ee exit vertex IDs, then b,pb,p.

Output

Print IMPOSSIBLE or the minimum speed in km/h, accepted within 10−610^{-6} absolute or relative error.

Subtasks

  • Subtask 1 (40 points): 3≤n≤6,  1≤e≤33\le n\le 6,\;1\le e\le 3. All input-format and graph conditions above apply.

  • Subtask 2 (60 points): 3≤n≤16,  1≤e≤33\le n\le 16,\;1\le e\le 3. All input-format and graph conditions above apply.

Examples

Input

3 2 1
1 2 7
2 3 8
1
2 3

Output

74.666666666667

Explanation

Police starts at 3, the brothers at 2, the exit at 1. Police can reach the exit over distance 15 at 160 km/h, while the brothers travel distance 7. Thus the limiting speed is 160⋅7/15=74.666666…160\cdot 7/15=74.666666\ldots km/h.