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;
struct point {
  double x, y;
  point(double _x = 0, double _y = 0) {
    x = _x;
    y = _y;
  }
  point operator+(point w) { return point(x + w.x, y + w.y); }
  point operator-(point w) { return point(x - w.x, y - w.y); }
  point operator*(double H) { return point(x * H, y * H); }
  double operator/(point w) {
    if (abs(w.x) > 1E-8) return x / w.x;
    return y / w.y;
  }
  bool operator==(point w) {
    return (abs(x - w.x) < 1E-8 && abs(y - w.y) < 1E-8);
  }
};
double sp(point a, point b) { return (a.x * b.x + a.y * b.y); }
inline double EQ_null(double A) {
  return (min(A * (1 - 1E-10), A * (1 + 1E-10)) < 0 &&
          0 < max(A * (1 - 1E-10), A * (1 + 1E-10)));
}
int ORI(point a, point b) {
  double O = a.x * b.y - a.y * b.x;
  return (EQ_null(O) || abs(O) < 1E-8) ? 0 : (O > 0 ? 1 : -1);
}
struct prava {
  double a, b, c;
  prava(point f = point(0, 0), point t = point(1, 1)) {
    a = t.y - f.y;
    b = f.x - t.x;
    c = t.x * f.y - f.x * t.y;
  }
  point IP(prava w) {
    point ret;
    if (abs(a) < 1E-8) {
      ret.y = (-c) / b;
      ret.x = (-w.b * ret.y - w.c) / w.a;
    } else {
      ret.y = (w.a * c - a * w.c) / (a * w.b - w.a * b);
      ret.x = (-b * ret.y - c) / a;
    }
    return ret;
  }
};
point BEG;
double X1, Y1, Z1, X2, Y2, Z2, D;
int n;
point M[10000];
point L1, L2;
bool is_in(point w) {
  w = w - BEG;
  if (ORI(L1, L2) == 0) {
    if (!(L1 == point(0, 0)) && ORI(L1, w) == 0 && (w / L1 >= 0)) return true;
    if (!(L2 == point(0, 0)) && ORI(L2, w) == 0 && (w / L2 >= 0)) return true;
    return false;
  }
  return (ORI(L1, L2) * ORI(L1, w) >= 0 && ORI(L2, L1) * ORI(L2, w) >= 0);
}
double t1 = 1E9, t2 = 1E9;
void get_time(point w) {
  if (ORI(L1, L2) != 0) {
    prava B(BEG, BEG + L1);
    double T1, T2, T3;
    point WIND(X2, Y2);
    T3 = (B.a * w.x + B.b * w.y + B.c) / (B.a * WIND.x + B.b * WIND.y);
    if (T3 < 0 && abs(T3) < 1E-8) T3 = 0;
    if (T3 < 0) return;
    T1 = point(w - WIND * T3 - BEG) / point(X1, Y1);
    if (T1 < 0 && abs(T1) < 1E-8) T1 = 0;
    if (T1 < 0) return;
    T2 = (T1 * Z1 + T3 * Z2) / (-D);
    if (T2 < 0 && abs(T2) < 1E-8) T2 = 0;
    if (T2 < 0) return;
    if (t1 > T1 || (abs(t1 - T1) < 1E-8 && t2 > T2)) {
      t1 = T1;
      t2 = T2;
    }
  } else {
    double T1, T2, T3;
    if (!(point(X1, Y1) == point(0, 0)) && point(X2, Y2) / point(X1, Y1) < 0) {
      T1 = (w - BEG) / point(X1, Y1);
      T2 = (-Z1 * T1) / D;
      if (T1 < 0 && abs(T1) < 1E-8) T1 = 0;
      if (T2 < 0 && abs(T2) < 1E-8) T2 = 0;
      if (T1 < 0 || T2 < 0) goto NEXT_TYPE;
      if (t1 > T1 || (abs(t1 - T1) < 1E-8 && t2 > T2)) {
        t1 = T1;
        t2 = T2;
      }
    NEXT_TYPE:
      point SUM = point(X1, Y1) + point(X2, Y2) * (-Z1 / Z2);
      if (SUM == point(0, 0)) return;
      T1 = (w - BEG) / SUM;
      T2 = 0;
      if (T1 < 0 && abs(T1) < 1E-8) T1 = 0;
      if (T1 < 0 || T2 < 0) return;
      if (t1 > T1 || (abs(t1 - T1) < 1E-8 && t2 > T2)) {
        t1 = T1;
        t2 = T2;
      }
    } else {
      point SUM = point(X1, Y1) + point(X2, Y2) * (-Z1 / Z2);
      if (SUM == point(0, 0)) return;
      T1 = (w - BEG) / SUM;
      T2 = 0;
      if (T1 < 0 && abs(T1) < 1E-8) T1 = 0;
      if (T1 < 0 || T2 < 0) return;
      if (t1 > T1 || (abs(t1 - T1) < 1E-8 && t2 > T2)) {
        t1 = T1;
        t2 = T2;
      }
    }
  }
}
int main() {
  int i, j, k, l;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) scanf("%lf%lf", &M[i].x, &M[i].y);
  scanf("%lf%lf", &BEG.x, &BEG.y);
  scanf("%lf%lf%lf%lf%lf%lf%lf", &X1, &Y1, &Z1, &D, &X2, &Y2, &Z2);
  L1 = point(X1, Y1);
  L2 = L1 - point(X2, Y2) * (Z1 / Z2);
  for (i = 0; i < n; ++i)
    if (is_in(M[i])) get_time(M[i]);
  for (i = 0; i < n; ++i) {
    j = i + 1;
    if (j >= n) j -= n;
    if (ORI(L1, M[i] - BEG) * ORI(L1, M[j] - BEG) < 0) {
      point T = prava(BEG, BEG + L1).IP(prava(M[i], M[j]));
      if (is_in(T)) get_time(T);
    }
    if (ORI(L2, M[i] - BEG) * ORI(L2, M[j] - BEG) < 0) {
      point T = prava(BEG, BEG + L2).IP(prava(M[i], M[j]));
      if (is_in(T)) get_time(T);
    }
  }
  if (t1 < 1E9)
    printf("%.12lf %.12lf\n", t1, t2);
  else
    printf("-1 -1\n");
  return 0;
}