Misha and Nadia each follow a polyline path in the plane at speed 1. Misha hands a package to a messenger at some point on his path. The messenger runs in a straight line to meet Nadia on her path and hands it over. The messenger also moves at speed 1. Find the minimum time from pickup to delivery.
Two path descriptions are given. Each starts with n points (xi,yi) visited in order. Misha and Nadia start at the same time without stopping. Pickup must happen no later than when Misha finishes, and delivery no later than when Nadia finishes.
Print the minimum delivery time with absolute error at most 10−3 or relative error at most 10−5. Print impossible if delivery cannot happen.