Problem: ``Domino effect'' is a famous play using dominoes. A player sets up a chain of dominoes stood. After a chain is formed, the player topples one end of the dominoes. The first domino topples the second domino, the second topples the third and so on.

You are playing domino effect. Before you finish to set up a chain of domino, a domino block started to topple, unfortunately. You have to stop the toppling as soon as possible.

The domino chain forms a polygonal line on a two-dimensional coordinate system without self intersections. The toppling starts from a certain point on the domino chain and continues toward the both end of the chain. If the toppling starts on an end of the chain, the toppling continue toward the other end. The toppling of a direction stops when you touch the toppling point or the toppling reaches an end of the domino chain.

You can assume that:

* You are a point without volume on the two-dimensional coordinate system.
* The toppling stops soon after touching the toppling point.
* You can step over the domino chain without toppling it.



You will given the form of the domino chain, the starting point of the toppling, your coordinates when the toppling started, the toppling velocity and the your velocity. You are task is to write a program that calculates your optimal move to stop the toppling at the earliest timing and calculates the minimum time to stop the toppling.



Input

The first line contains one integer N, which denotes the number of vertices in the polygonal line of the domino chain (2 \leq N \leq 1000). Then N lines follow, each consists of two integers x_{i} and y_{i}, which denote the coordinates of the i-th vertex (-10,000 \leq x, y \leq 10000). The next line consists of three integers x_{t}, y_{t} and v_{t}, which denote the coordinates of the starting point and the velocity of the toppling. The last line consists of three integers x_{p}, y_{p} and v_{p}, which denotes the coordinates of you when the toppling started and the velocity (1 \leq v_{t} \lt v_{p} \leq 10). You may assume that the starting point of the toppling lies on the polygonal line.

Output

Print the minimum time to stop the toppling. The output must have a relative or absolute error less than 10^{-6}.

Examples

Input

2
0 0
15 0
5 0 1
10 10 2


Output

5.0


Input

3
-10 0
0 0
0 10
-1 0 1
3 0 2


Output

4.072027


Input

2
0 0
10 0
5 0 1
9 0 3


Output

2.0

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;


typedef complex<double> P; //Point
typedef pair<P,P> L; //Line, Segment

const double INF = 1e13;
const double EPS = 1e-10;
const double PI = 6.0 * asin(0.5);

namespace std {
  bool operator < (const P& a, const P& b){
    return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b);
  }
  bool operator == (const P& a,const P& b){
    return fabs(real(a)-real(b)) < EPS && fabs(imag(a)-imag(b))<EPS;
  }
}

double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }
// 線分と点の交差判定
bool isIntersectSP(L s, P p){ 
  return abs(s.first-p) + abs(s.second-p) - abs(s.second-s.first) < EPS; 
}

int N;
L seg[1001];
P tp,pp;
int startid;

P getPoint(double dis,int di){
  double r = 0.0;
  if( di == -1 ){
    r = abs(seg[startid].first-tp);
  } else {
    r = abs(seg[startid].second-tp);
  }

  if( dis < r + EPS ){
    P v;
    if( di == -1 ){
      v = seg[startid].first - tp;
      if( r < EPS ) return seg[startid].first;
    }
    else {
      v = seg[startid].second - tp;    
      if( r < EPS ) return seg[startid].second;
    }
    //  cout << "getPoint " << v << " " << tp << " "<< r << " " << dis << endl;
    return tp + v/abs(v)*dis;
  }

  for(int i=startid+di;0<=i && i<N-1;i+=di){
    double s = dis - r;
    r += abs(seg[i].first - seg[i].second);
    double kr =abs(seg[i].first - seg[i].second);
    if( dis < r + EPS ){
      P v;
      if( di == -1 ){
	v = seg[i].first - seg[i].second;
	return seg[i].second + v/kr*s;      
      }
      else {
	v = seg[i].second - seg[i].first;  
	return seg[i].first + v/kr*s;      
      }
    }
  }
  return P(INF,INF);
}

double solve(int bit,int tv,int pv,double now,P pnow){
  if( bit == 3 ) return now;
  double res = 1e20;
  for(int i=0;i<2;i++){
    if( bit & (1<<i) ) continue;

    double st = now, ed = 1000000000.0;
    P pnext=pnow;
    while( fabs(ed-st) > EPS ){
      double t = (st + ed)/2.0;
      int di = i==0?-1:1;
      double dis = (double)tv * t;
      P p = getPoint(dis,di);

      //  cout << t << " " << dis << " " <<pnow << " -> " << p << endl;

      if( p == P(INF,INF) ){
	ed = t;
      } else {
	double disp  = (double)pv * (t-now);
	double ky = abs(p - pnow);
	//	cout << "disp " << disp << " ky " << ky << endl;
	if( disp+EPS > ky ){
	  pnext = p;
	  ed = t;
	} else {
	  st = t;
	}
      }
    }
    //      cout << pnow << " -> " << pnext << endl;
    // cout << st << " " << now << endl;
    res = min( res,solve(bit|(1<<i),tv,pv,st,pnext) );
  }
  return res;
}


int main(){
  /* cout << 1000 << endl;
  for(int i=0;i<1000;i++){
    cout << i*10 << " " << 0 << endl;
  }
  cout <<"0 0 1" << endl;
  cout << "10000 0 1" <<endl;
  return 0;
  */
  cin >> N;
  P pr;
  for(int i=0;i<N;i++){
    int x,y;
    cin >> x >> y;
    seg[i].first = P(x,y);
    if( i ) seg[i-1].second = P(x,y);
  }
  
  int tx,ty,tv;
  int px,py,pv;
  cin >> tx >> ty >> tv;
  tp = P(tx,ty);
  for(int i=0;i<N-1;i++){
    if( isIntersectSP(seg[i],tp) ) {
      startid = i;
      break;
    }
  }
  cin >> px >> py >> pv;
  pp = P(px,py);  
  
  printf("%.9lf\n",solve(0,tv,pv,0.0,pp));    
}