You are competing in a ski slalom, and you need to select the best skis for the race. The format of the race is that there are

*N*

pairs of left and right gates, where each right gate is

*W*

metres to the right of its corresponding left gate, and you may neither pass to the left of the left gate nor to the right of the right gate. The

*i*

^{th}

pair of gates occurs at distance

*y*

_{i}down the hill, with the horizontal position of the

*i*

^{th}

left gate given by

*x*

_{i}. Each gate is further down the hill than the previous gate (i.e.

*y*

_{i}<

*y*

_{i+1}for all

*i*

).

You may select from *S* pairs of skis, where the *j*^{th} pair has speed *s _{j}*. Your movement is governed by the following rule: if you select a pair of skis with speed

*s*, you move with a constant downward velocity of

_{j}*s*metres per second. Additionally, at any time you may move at a horizontal speed of at most

_{j}*v*metres per second.

_{h}You may start and finish at any two horizontal positions. Determine which pair of skis will allow you to get through the race course, passing through all the gates, in the shortest amount of time.