Problem: How horrible! The empire of galactic chickens tries to conquer a beautiful city «Z», they have built a huge incubator that produces millions of chicken soldiers a day, and fenced it around. The huge incubator looks like a poligon on the the plane Oxy with n vertices. Naturally, DravDe can't keep still, he wants to destroy the chicken empire. For sure, he will start with the incubator.

DravDe is strictly outside the incubator's territory in point A(xa, ya), and wants to get inside and kill all the chickens working there. But it takes a lot of doing! The problem is that recently DravDe went roller skating and has broken both his legs. He will get to the incubator's territory in his jet airplane LEVAP-41.

LEVAP-41 flies at speed V(xv, yv, zv). DravDe can get on the plane in point A, fly for some time, and then air drop himself. DravDe is very heavy, that's why he falls vertically at speed Fdown, but in each point of his free fall DravDe can open his parachute, and from that moment he starts to fall at the wind speed U(xu, yu, zu) until he lands. Unfortunately, DravDe isn't good at mathematics. Would you help poor world's saviour find such an air dropping plan, that allows him to land on the incubator's territory? If the answer is not unique, DravDe wants to find the plan with the minimum time of his flight on the plane. If the answers are still multiple, he wants to find the one with the minimum time of his free fall before opening his parachute

Input

The first line contains number n (3 ≤ n ≤ 104) — amount of vertices of the fence. Then there follow n lines containing the coordinates of these vertices (two integer numbers xi, yi) in clockwise or counter-clockwise order. It's guaranteed, that the fence does not contain self-intersections.

The following four lines contain coordinates of point A(xa, ya), speeds V(xv, yv, zv), Fdown and speed U(xu, yu, zu). All the input numbers are integer. All the coordinates don't exceed 104 in absolute value. It's guaranteed, that zv > 0 and Fdown, zu < 0, and point A is strictly outside the incubator's territory.

Output

In the first line output two numbers t1, t2 such, that if DravDe air drops at time t1 (counting from the beginning of the flight), he lands on the incubator's territory (landing on the border is regarder as landing on the territory). If DravDe doesn't open his parachute, the second number should be equal to the duration of DravDe's falling down. If it's impossible for DravDe to get to the incubator's territory, output -1 -1. If the answer is not unique, output the answer with the minimum t1. If the answers are still multiple, output the answer with the minimum t2. Your answer must have an absolute or relative error less than 10 - 6.

Examples

Input

4
0 0
1 0
1 1
0 1
0 -1
1 0 1
-1
0 1 -1


Output

1.00000000 0.00000000


Input

4
0 0
0 1
1 1
1 0
0 -1
-1 -1 1
-1
0 1 -1


Output

-1.00000000 -1.00000000


Input

4
0 0
1 0
1 1
0 1
0 -1
1 1 1
-1
1 1 -1


Output

0.50000000 0.00000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
double prodesc(complex<double> p1, complex<double> p2) {
  return real(conj(p1) * p2);
}
double prodvec(complex<double> p1, complex<double> p2) {
  return imag(conj(p1) * p2);
}
double error = 0.00000001;
void llegeix(complex<double> &p) {
  int x, y;
  cin >> x >> y;
  p = complex<double>(x, y);
}
int n;
vector<complex<double> > poligon;
complex<double> a;
complex<double> v;
double vz;
double fdown;
complex<double> u;
double uz;
pair<double, double> tminim;
bool hihatminim;
complex<double> vfora;
void nout(pair<double, double> t) {
  if ((not hihatminim) or t < tminim) {
    tminim = t;
    hihatminim = true;
  }
}
complex<double> computavfora() {
  double time = vz / uz;
  return v + time * u;
}
complex<double> interseccio(complex<double> p1, complex<double> u1,
                            complex<double> p2, complex<double> u2) {
  return p1 + (prodvec(p2 - p1, u2) / prodvec(u1, u2)) * u1;
}
void interseccio(complex<double> p1, complex<double> u1, complex<double> p2,
                 complex<double> u2, complex<double> &p,
                 bool &hihainterseccio) {
  p = p1 + (prodvec(p2 - p1, u2) / prodvec(u1, u2)) * u1;
  if (prodesc(u1, p - p1) > -error and prodesc(u2, p - p2) > -error and
      prodesc(-u2, p - (p2 + u2)) > -error)
    hihainterseccio = true;
  else
    hihainterseccio = false;
}
void computapuntnoparalel(complex<double> p) {
  if ((prodvec(v, vfora) > 0 and prodvec(v, p - a) > -error and
       prodvec(p - a, vfora) > -error) or
      (prodvec(v, vfora) < 0 and prodvec(v, p - a) < error and
       prodvec(p - a, vfora) < error)) {
    complex<double> inter = interseccio(a, v, p, u);
    double vtime = abs(inter - a) / abs(v);
    double vh = vtime * vz;
    double utime = abs(inter - p) / abs(u);
    double uh = utime * uz;
    double ftime = (vh - uh) / fdown;
    nout(pair<double, double>(vtime, ftime));
  }
}
void computaminimnoparalel() {
  hihatminim = false;
  vfora = computavfora();
  for (int i = 0; i < n; i++) {
    complex<double> p = poligon[i];
    computapuntnoparalel(p);
    complex<double> pnext = poligon[(i + 1) % n];
    bool hihainterseccio;
    complex<double> inter;
    if (abs(prodvec(v, pnext - p)) > error) {
      interseccio(a, v, p, pnext - p, inter, hihainterseccio);
      if (hihainterseccio) computapuntnoparalel(inter);
    }
    if (abs(prodvec(vfora, pnext - p)) > error) {
      interseccio(a, vfora, p, pnext - p, inter, hihainterseccio);
      if (hihainterseccio) computapuntnoparalel(inter);
    }
  }
}
void computapuntcaiguda(complex<double> p) {
  if (abs(v) < error) return;
  if (abs(prodvec(v, p - a)) > error) return;
  if (prodesc(v, p - a) < -error) return;
  double vtime = abs(p - a) / abs(v);
  double vh = vtime * vz;
  double ftime = vh / fdown;
  nout(pair<double, double>(vtime, ftime));
}
void computapuntnocaiguda(complex<double> p) {
  complex<double> dir = v;
  if (abs(v) < error) dir = u;
  dir = dir / abs(dir);
  if (abs(prodvec(dir, p - a)) > error) return;
  complex<double> vv(prodesc(v, dir), vz);
  complex<double> uu(prodesc(u, dir), -uz);
  complex<double> pp(prodesc(p - a, dir), 0);
  complex<double> aa(0, 0);
  if (abs(prodvec(vv, uu)) < error) return;
  complex<double> inter = interseccio(aa, vv, pp, uu);
  double vtime = abs(inter - aa) / abs(vv);
  if (prodesc(vv, inter - aa) < error) return;
  if (prodesc(uu, pp - inter) < error) return;
  nout(pair<double, double>(vtime, 0));
}
void computaminimparalel() {
  hihatminim = false;
  for (int i = 0; i < n; i++) {
    complex<double> p = poligon[i];
    computapuntcaiguda(p);
    computapuntnocaiguda(p);
    complex<double> pnext = poligon[(i + 1) % n];
    complex<double> dir = v;
    if (abs(v) < error) dir = u;
    bool hihainterseccio;
    complex<double> inter;
    if (abs(prodvec(dir, pnext - p)) > error) {
      interseccio(a, dir, p, pnext - p, inter, hihainterseccio);
      if (hihainterseccio) {
        computapuntcaiguda(inter);
        computapuntnocaiguda(inter);
      }
      interseccio(a, -dir, p, pnext - p, inter, hihainterseccio);
      if (hihainterseccio) {
        computapuntcaiguda(inter);
        computapuntnocaiguda(inter);
      }
    }
  }
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(8);
  cin >> n;
  poligon = vector<complex<double> >(n);
  for (int i = 0; i < n; i++) llegeix(poligon[i]);
  llegeix(a);
  llegeix(v);
  cin >> vz;
  cin >> fdown;
  fdown = -fdown;
  llegeix(u);
  cin >> uz;
  uz = -uz;
  if (abs(v) < error and abs(u) < error)
    hihatminim = false;
  else if (abs(prodvec(v, u)) < error)
    computaminimparalel();
  else
    computaminimnoparalel();
  if (hihatminim)
    cout << tminim.first << " " << tminim.second << endl;
  else
    cout << -1.0 << " " << -1.0 << endl;
}