A pricing service knows a handful of direct exchange rates and must answer conversion queries between any two currencies, chaining rates when no direct pair exists.
Write convert_rates(rates, queries) that returns a list of floats, one per query.
rates: a list of tuples (src, dst, rate) meaning 1 unit of src buys rate units of dst (). Each rate also implies the reverse rate from dst to src.queries: a list of tuples (src, dst).dst that 1 unit of src buys, found by multiplying rates along any chain of known pairs. Round each answer to 6 decimal places.-1.0 when either currency never appears in rates or when no chain connects them.1.0.You may assume the given rates are consistent: every chain between the same two currencies gives the same product. Up to rates and queries.