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;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const int MAX = 300;
const long double eps = 1e-13;
const long double eps2 = 1e-11;
int n;
int m;
int x1, y8687969, z1, x2, y2, z2, f, x[10001], y[10001];
int vect(int x1, int y8687969, int x2, int y2) {
  return x1 * y2 - x2 * y8687969;
}
int scal(int x1, int y8687969, int x2, int y2) {
  return x1 * x2 + y8687969 * y2;
}
int _in(long long xx, long long yy) {
  long long sum = 0, rl = 0;
  for (int i = 0; i < n; i++) {
    sum += abs((x[i] - xx) * (y[i + 1] - yy) - (x[i + 1] - xx) * (y[i] - yy));
    rl += x[i] * y[i + 1] - x[i + 1] * y[i];
  }
  if (sum != abs(rl)) return 0;
  return 1;
}
int _in2(long double xx, long double yy) {
  long double sum = 0, rl = 0;
  for (int i = 0; i < n; i++) {
    sum += fabs((x[i] - xx) * (y[i + 1] - yy) - (x[i + 1] - xx) * (y[i] - yy));
    rl += x[i] * y[i + 1] - x[i + 1] * y[i];
  }
  if (fabs(sum - abs(rl)) > eps) return 0;
  return 1;
}
int cross(long long x1, long long y8687969, long long x2, long long y2,
          long long x3, long long y3, long long x4, long long y4,
          long double *t, int r1, int r2) {
  long long a = x2 - x1;
  long long b = x3 - x4;
  long long c = x3 - x1;
  long long d = y2 - y8687969;
  long long e = y3 - y4;
  long long f = y3 - y8687969;
  if (a * e - b * d != 0) {
    long long Q = (a * e - b * d);
    long long T = (c * e - b * f);
    long long S = (a * f - c * d);
    if (Q < 0) {
      T = -T;
      S = -S;
      Q = -Q;
    }
    int ok = 1;
    if (r1 & 1) ok &= int(T >= 0);
    if (r1 & 2) ok &= int(T <= Q);
    if (r2 & 1) ok &= int(S >= 0);
    if (r2 & 2) ok &= int(S <= Q);
    if (ok) {
      *t = (long double)T / Q;
      return 1;
    }
  }
  return 0;
}
int cross2(long double x1, long double y8687969, long double x2, long double y2,
           long double x3, long double y3, long double x4, long double y4,
           long double *t, int r1, int r2) {
  long double a = x2 - x1;
  long double b = x3 - x4;
  long double c = x3 - x1;
  long double d = y2 - y8687969;
  long double e = y3 - y4;
  long double f = y3 - y8687969;
  if (a * e - b * d != 0) {
    long double Q = (a * e - b * d);
    long double T = (c * e - b * f);
    long double S = (a * f - c * d);
    if (Q < 0) {
      T = -T;
      S = -S;
      Q = -Q;
    }
    int ok = 1;
    if (r1 & 1) ok &= int(T > -eps * Q);
    if (r1 & 2) ok &= int(T < Q * (1 + eps));
    if (r2 & 1) ok &= int(S > -eps * Q);
    if (r2 & 2) ok &= int(S < Q * (1 + eps));
    if (ok) {
      *t = (long double)T / Q;
      return 1;
    }
  }
  return 0;
}
int check(long long x1, long long y8687969, long long x2, long long y2,
          long double *t, int r1, int r2) {
  if (_in(x1, y8687969)) {
    *t = 0;
    return 1;
  }
  int ok = 0;
  long double nt;
  *t = 1e20;
  for (int i = 0; i < n; i++)
    if (cross(x1, y8687969, x2, y2, x[i], y[i], x[i + 1], y[i + 1], &nt, r1,
              r2)) {
      *t = min(*t, nt);
      ok = 1;
    }
  return ok;
}
int check2(long double x1, long double y8687969, long double x2, long double y2,
           long double *t, int r1, int r2) {
  if (_in2(x1, y8687969)) {
    *t = 0;
    return 1;
  }
  int ok = 0;
  long double nt;
  *t = 1e20;
  for (int i = 0; i < n; i++)
    if (cross2(x1, y8687969, x2, y2, x[i], y[i], x[i + 1], y[i + 1], &nt, r1,
               r2)) {
      *t = min(*t, nt);
      ok = 1;
    }
  return ok;
}
int check3(long double x1, long double y8687969, long double x2, long double y2,
           int i) {
  return int((x[i] - x1) * (x[i] - x2) + (y[i] - y8687969) * (y[i] - y2) < eps);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &x[i], &y[i]);
  int X, Y;
  scanf("%d%d", &X, &Y);
  for (int i = 0; i < n; i++) {
    x[i] -= X;
    y[i] -= Y;
  }
  x[n] = x[0];
  y[n] = y[0];
  scanf("%d%d%d", &x1, &y8687969, &z1);
  scanf("%d", &f);
  f = -f;
  scanf("%d%d%d", &x2, &y2, &z2);
  z2 = -z2;
  int x3 = x1 * z2 + x2 * z1, y3 = y8687969 * z2 + y2 * z1;
  long double t1 = 1e20, t2 = 1e20, t, tt;
  if (check(0, 0, x1, y8687969, &t, 1, 3)) {
    check2(x1 * t + x2 * ((z1 * t) / z2), y8687969 * t + y2 * ((z1 * t) / z2),
           x1 * t, y8687969 * t, &tt, 3, 3);
    tt *= ((z1 * t) / f);
    if (t1 > t + eps || fabs(t - t1) < eps && t2 > tt + eps) {
      t1 = t;
      t2 = tt;
    }
  }
  if (check(0, 0, x3, y3, &t, 1, 3)) {
    t *= z2;
    check2(x1 * t + x2 * ((z1 * t) / z2), y8687969 * t + y2 * ((z1 * t) / z2),
           x1 * t, y8687969 * t, &tt, 3, 3);
    tt *= ((z1 * t) / f);
    if (t1 > t + eps || fabs(t - t1) < eps && t2 > tt + eps) {
      t1 = t;
      t2 = tt;
    }
  }
  if (vect(x1, y8687969, x2, y2) != 0) {
    long double T = 1e20, r;
    for (int i = 0; i < n; i++)
      if (cross(0, 0, x1, y8687969, x[i], y[i], x[i] - x2 * z1, y[i] - y2 * z1,
                &r, 1, 1))
        T = min(T, r);
    if (T < 5e19) {
      long double t = T, tt;
      if (check2(x1 * T + x2 * ((z1 * T) / z2),
                 y8687969 * T + y2 * ((z1 * T) / z2), x1 * T, y8687969 * T, &tt,
                 3, 3)) {
        tt *= ((z1 * T) / f);
        if (t1 > t + eps || fabs(t - t1) < eps && t2 > tt + eps) {
          t1 = t;
          t2 = tt;
        }
      }
    }
  }
  if (t1 > 5e19)
    printf("-1 -1\n");
  else
    printf("%.15f %.15f\n", (double)t1, (double)t2);
  return 0;
}