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 <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <functional>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;
int N,st;
double xt,yt,vt,xs,ys,vs;
vector<P> vc;
D inf=1e50,eps=1e-10,tt[1001];
P t,s;
bool eq(D a, D b) { return abs(a-b)<eps;}
bool eq(P a, P b) { return abs(a-b)<eps;}
int sig(D a) { return eq(a,0) ? 0 : (a>0 ? 1 : -1);}
inline D cro(P a, P b) { return imag(conj(a)*b);};
inline int ccw (P a, P b, P c){
//	cout << cro(b-a,c-a) << endl;
	if(sig(cro(b-a,c-a))==1) return 1;
	if(sig(cro(b-a,c-a))==-1) return -1;
	if(eq(abs(a-c)+abs(c-b),abs(a-b))) return 0;
	if(eq(abs(a-b)+abs(b-c),abs(a-c))) return -2;
	if(eq(abs(c-a)+abs(a-b),abs(c-b))) return 2;
}
P t0(D x){
	for(int i=st;i>=0;i--){
		if(tt[i]>x){
			D left=x-tt[i+1];
			P ret=vc[i+1];
			ret+=(vc[i]-vc[i+1])/abs(vc[i]-vc[i+1])*left*vt;
			return ret;
		}
	}
	return vc[0];
}
P t1(D x){
	for(int i=st;i<N;i++){
		if(tt[i]>x){
			D left=x-tt[i-1];
			P ret=vc[i-1];
			ret+=(vc[i]-vc[i-1])/abs(vc[i]-vc[i-1])*left*vt;
			return ret;
		}
	}
	return vc[N-1];
}
int main(){
	cin>>N;
	rep(i,N){
		int x,y;
		cin>>x>>y;
		vc.pb(P(x,y));
	}
	cin>>xt>>yt>>vt>>xs>>ys>>vs;
	t=P(xt,yt);
	s=P(xs,ys);
	rep(i,N-1){
		if(ccw(vc[i],vc[i+1],t)==0){
			if(vc[i]==t){
				st=i;
				break;
			}
			if(vc[i+1]==t){
				st=i+1;
				break;
			}
			vc.insert(vc.begin()+i+1,t);
			st=i+1;
			break;
		}
	}
	N=vc.size();
	D now=0;
	for(int i=st;i>=0;i--){
		tt[i]=now;
		if(i==0) break;
		now+=abs(vc[i]-vc[i-1])/vt;
	}
	now=0;
	for(int i=st;i<N;i++){
		tt[i]=now;
		if(i==N-1) break;
		now+=abs(vc[i]-vc[i+1])/vt;
	}
	D ans=max(tt[0],tt[N-1]);
	//first 0
	D ub=tt[0],lb=0;
	rep(i,200){
		D m=(ub+lb)/2;
		if(abs(t0(m)-s)<m*vs) ub=m;
		else lb=m;
	}
	ans=min(ans,max(tt[N-1],ub));
	D nowt=ub;
	if(!eq(nowt,tt[0])){
		//show(nowt);
		P nows=t0(nowt);
		//show(nows);
		ub=1e10,lb=0;
		rep(i,200){
			D m=(ub+lb)/2;
			if(abs(t1(m+nowt)-nows)<m*vs) ub=m;
			else lb=m;
		}
		ans=min(ans,nowt+ub);
	}
	//first 1
	ub=tt[N-1],lb=0;
	rep(i,200){
		D m=(ub+lb)/2;
		if(abs(t1(m)-s)<m*vs) ub=m;
		else lb=m;
	}
	ans=min(ans,max(tt[0],ub));
	nowt=ub;
	if(!eq(nowt,tt[N-1])){
		P nows=t1(nowt);
		ub=1e10,lb=0;
		rep(i,200){
			D m=(ub+lb)/2;
			if(abs(t0(m+nowt)-nows)<m*vs) ub=m;
			else lb=m;
		}
		ans=min(ans,nowt+ub);
	}
	printf("%.12f\n",ans);
}