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;
const double ep = 1e-8;
struct pnt {
  double x, y;
  pnt(double x = 0, double y = 0) : x(x), y(y) {}
  double operator^(const pnt &b) { return x * b.y - y * b.x; }
  double operator&(const pnt &b) { return x * b.x + y * b.y; }
  double dist() { return sqrt(x * x + y * y); }
  pnt operator+(const pnt &b) { return pnt(x + b.x, y + b.y); }
  pnt operator-(const pnt &b) { return pnt(x - b.x, y - b.y); }
  pnt operator*(double b) { return pnt(x * b, y * b); }
  pnt operator/(double b) { return pnt(x / b, y / b); }
  pnt operator-() { return pnt(-x, -y); }
  void in() { scanf("%lf %lf", &x, &y); }
} p[10100], A, V, U;
double F, zv, zu;
inline int sgn(double d) { return d < -ep ? -1 : d > ep; }
bool inside(pnt a, pnt b, pnt c) {
  return abs(a - b ^ a - c) < ep && (a - b & a - c) <= 0;
}
int inter_line(pnt a, pnt b, pnt c, pnt d, pnt &rlt) {
  double s = a - b ^ c - d;
  if (abs(s) < ep) return 0;
  double x = (a - d ^ c - d) / s;
  rlt = a * (1 - x) + b * x;
  return 1;
}
int n;
double T1 = 1e9, T2 = 1e9;
inline void update(double t1, double t2) {
  int c = sgn(t1 - T1);
  if (c > 0) return;
  if (c < 0)
    T1 = t1, T2 = t2;
  else if (t2 < T2)
    T2 = t2;
}
double d1, d2;
void check(pnt c) {
  int p = sgn(V ^ c - A), q = sgn(c - A ^ V - U), r = sgn(V ^ V - U);
  if (p && p != r) return;
  if (q && q != r) return;
  pnt tmp;
  assert(inter_line(c, c + U, A, A + V - U, tmp) == 1);
  update((tmp - A).dist() / d1, (tmp - c).dist() / d2);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) p[i].in();
  A.in(), V.in();
  scanf("%lf", &zv);
  scanf("%lf", &F), U.in(), scanf("%lf", &zu);
  d2 = F * U.dist() / zu;
  U = U * zv / zu;
  d1 = (V - U).dist();
  if (sgn(U ^ V)) {
    for (int i = 0; i < n; i++) check(p[i]);
    for (int i = 0, j = 1; i < n; i++, j++) {
      if (j == n) j = 0;
      pnt tmp;
      if (inter_line(p[i], p[j], A, A + V - U, tmp) && inside(tmp, p[i], p[j]))
        check(tmp);
      if (inter_line(p[i], p[j], A, A + V, tmp) && inside(tmp, p[i], p[j]))
        check(tmp);
    }
  } else {
    if (sgn(V & U) <= 0) {
      for (int i = 0, j = 1; i < n; i++, j++) {
        if (j == n) j = 0;
        pnt tmp;
        if (inter_line(p[i], p[j], A, A + V - U, tmp) &&
            inside(tmp, p[i], p[j])) {
          if (sgn(tmp - A & V - U) >= 0) update((tmp - A).dist() / d1, 0);
        }
      }
    } else {
      int sg = sgn(V.dist() - U.dist());
      if (sg >= 0) {
        for (int i = 0, j = 1; i < n; i++, j++) {
          if (j == n) j = 0;
          pnt tmp;
          if (inter_line(p[i], p[j], A, A + V, tmp) &&
              inside(tmp, p[i], p[j])) {
            if (sgn(tmp - A & V) >= 0) {
              double t = (tmp - A).dist() / V.dist();
              update(t, (tmp - A - (V - U) * t).dist() / d2);
            }
          }
        }
      } else if (sg < 0) {
        for (int i = 0, j = 1; i < n; i++, j++) {
          if (j == n) j = 0;
          pnt tmp;
          if (inter_line(p[i], p[j], A, A + V, tmp) &&
              inside(tmp, p[i], p[j])) {
            if (sgn(tmp - A & V) >= 0) {
              double t = (tmp - A).dist() / V.dist();
              update(t, (tmp - A - (V - U) * t).dist() / d2);
            } else
              update((tmp - A).dist() / d1, 0);
          }
        }
      }
    }
  }
  if (T1 > 1e6)
    puts("-1 -1");
  else
    printf("%.8lf %.8lf\n", T1, T2);
  return 0;
}