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>
inline int SG(double x) {
  if (x > -1E-8 && x < 1E-8) return 0;
  return x > 0 ? 1 : -1;
}
class PT {
 public:
  double x, y;
  PT() {}
  PT(double _x, double _y) {
    x = _x;
    y = _y;
  }
  PT operator+(const PT& p) const { return PT(x + p.x, y + p.y); }
  PT operator-(const PT& p) const { return PT(x - p.x, y - p.y); }
  PT operator*(const double c) const { return PT(x * c, y * c); }
  PT operator/(const double c) const { return PT(x / c, y / c); }
  double operator*(const PT& p) const { return x * p.x + y * p.y; }
  double operator^(const PT& p) const { return x * p.y - y * p.x; }
  double len() { return sqrt(x * x + y * y); }
  void prt() { printf("%.5f %.5f\n", x, y); }
};
PT pt[20000];
inline double tri(PT p1, PT p2, PT p3) { return (p2 - p1) ^ (p3 - p1); }
inline int sect(PT p1, PT p2, PT p3, PT p4) {
  int ta, tb, tc, td;
  ta = SG(tri(p1, p2, p3));
  tb = SG(tri(p1, p2, p4));
  tc = SG(tri(p3, p4, p1));
  td = SG(tri(p3, p4, p2));
  if (ta * tb < 0 && tc * td < 0) return 1;
  if (ta == 0 && tb == 0) return 0;
  if (ta * tb < 0) {
    if (tc == 0 && td > 0) return 1;
    if (td == 0 && tc > 0) return 1;
  }
  return 0;
}
inline int sectPT(PT p1, PT p2, PT p3, PT p4, PT& p) {
  double ta, tb, tc, td;
  ta = tri(p1, p2, p3);
  tb = tri(p1, p2, p4);
  tc = tri(p3, p4, p1);
  td = tri(p3, p4, p2);
  if (SG(ta) == 0 && SG(tb) == 0) {
    return 0;
  } else if (SG(ta) * SG(tb) <= 0 && SG(tc) * SG(td) <= 0) {
    p = (p3 * tb - p4 * ta) / (tb - ta);
    return 1;
  }
  return 0;
}
inline int onSeg(PT p, PT p1, PT p2) {
  if (SG(tri(p, p1, p2)) == 0 && SG((p2 - p) * (p1 - p)) <= 0) return 1;
  return 0;
}
int main() {
  int n, i, cs;
  PT A, V, U, D, W, B, T;
  double F, vz, uz, t, s, t1, t2;
  while (scanf("%d", &n) == 1) {
    for (i = 0; i < n; i++) {
      scanf("%lf %lf", &pt[i].x, &pt[i].y);
    }
    pt[n] = pt[0];
    scanf("%lf %lf", &A.x, &A.y);
    scanf("%lf %lf %lf", &V.x, &V.y, &vz);
    scanf("%lf", &F);
    scanf("%lf %lf %lf", &U.x, &U.y, &uz);
    F = -F;
    uz = -uz;
    if (SG(V ^ U) == 0) {
      t1 = 1E20;
      W = V + (U * (vz / uz));
      for (i = 0; i < n; i++) {
        D = pt[i + 1] - pt[i];
        if (SG(W ^ D)) {
          t = ((pt[i] - A) ^ D) / (W ^ D);
          if (SG(t) >= 0) {
            B = A + (W * t);
            if (SG((B - pt[i]) * (B - pt[i + 1])) <= 0 && t < t1) {
              t1 = t;
            }
          }
        }
        if (SG(V ^ D)) {
          t = ((pt[i] - A) ^ D) / (V ^ D);
          if (SG(t) >= 0) {
            B = A + (V * t);
            if (SG((B - pt[i]) * (B - pt[i + 1])) <= 0 && t < t1) {
              t1 = t;
            }
          }
        }
      }
    } else {
      t1 = 1E20;
      W = V + (U * (vz / uz));
      for (i = 0; i < n; i++) {
        D = pt[i] - A;
        t = (D ^ U) / (V ^ U);
        if (SG(t) >= 0) {
          D = D - (V * t);
          s = SG(U.x) ? D.x / U.x : D.y / U.y;
          if (SG(s) >= 0 && SG(s * uz - t * vz) <= 0 && t < t1) {
            t1 = t;
          }
        }
        D = pt[i + 1] - pt[i];
        if (SG(W ^ D)) {
          t = ((pt[i] - A) ^ D) / (W ^ D);
          if (SG(t) >= 0) {
            B = A + (W * t);
            if (SG((B - pt[i]) * (B - pt[i + 1])) <= 0 && t < t1) {
              t1 = t;
            }
          }
        }
        if (SG(V ^ D)) {
          t = ((pt[i] - A) ^ D) / (V ^ D);
          if (SG(t) >= 0) {
            B = A + (V * t);
            if (SG((B - pt[i]) * (B - pt[i + 1])) <= 0 && t < t1) {
              t1 = t;
            }
          }
        }
      }
    }
    if (t1 > 1E18) {
      printf("%.8f %.8f\n", -1.0, -1.0);
      continue;
    }
    if (SG(U.x) == 0 && SG(U.y) == 0) {
      t2 = 0;
    } else {
      B = A + V * t1;
      D = B + U * (vz * t1 / uz);
      for (i = 0; i < n; i++) {
        if (onSeg(D, pt[i], pt[i + 1])) break;
      }
      if (i == n) {
        cs = 0;
        for (i = 0; i < n; i++) {
          if (sect(pt[i], pt[i + 1], D, D + PT(100000, 0))) cs++;
        }
        cs %= 2;
      } else {
        cs = 1;
      }
      if (cs == 1) {
        t2 = 0;
      } else {
        for (i = 0; i < n; i++) {
          if (sectPT(pt[i], pt[i + 1], D, B, T)) {
            B = T;
          }
        }
        t2 = (B - D).len() / U.len() * uz / F;
      }
    }
    printf("%.8f %.8f\n", t1, t2);
  }
  return 0;
}