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;
const double pi = 3.141592653589793238l;
struct pnt {
  double x, y;
  pnt(double x = 0, double y = 0) : 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*(const double &b) { return pnt(x * b, y * b); }
  pnt operator/(const double &b) { return pnt(x / b, y / b); }
  double operator&(const pnt &b) { return x * b.x + y * b.y; }
  double operator^(const pnt &b) { return x * b.y - b.x * y; }
  bool operator==(const pnt &b) {
    return abs(x - b.x) < ep && abs(y - b.y) < ep;
  }
  double dist() { return sqrt(x * x + y * y); }
  void input() { scanf("%lf %lf", &x, &y); }
} p[10005], A, V, U, K[2];
double zv, zu, f;
vector<pnt> C;
int inter_line(pnt a, pnt b, pnt c, pnt d, pnt &rlt) {
  double S = a - b ^ c - d;
  double S1 = a - b ^ c - b;
  if (abs(S) < ep) {
    if (abs(S1) < ep)
      return -1;
    else
      return 0;
  }
  double r = S1 / S;
  rlt = d * r + c * (1 - r);
  return 1;
}
bool inside(pnt p, pnt b, pnt c) {
  return abs(p - b ^ p - c) < ep && (p - b & p - c) <= 0;
}
int inter_line_seg(pnt a, pnt b, pnt c, pnt d, pnt &rlt) {
  double s = a - b ^ c - d;
  if (abs(s) < ep) {
    if (abs(b - a ^ c - a) < ep) return 2;
    return -1;
  }
  int k = inter_line(a, b, c, d, rlt);
  assert(k == 1);
  return inside(rlt, c, d);
}
bool on_ray(pnt a, pnt b, pnt p) {
  return abs(p - a ^ b - a) < ep && (b - a & p - a) > -ep;
}
int inter_ray_seg(pnt a, pnt b, pnt c, pnt d, pnt &A, pnt &B) {
  int k = inter_line_seg(a, b, c, d, A);
  if (k == 2) {
    if (on_ray(a, b, c) && on_ray(a, b, d)) {
      A = c, B = d;
      return 2;
    }
    if (on_ray(a, b, c)) {
      A = a, B = c;
      return 2;
    }
    if (on_ray(a, b, d)) {
      A = a, B = d;
      return 2;
    }
    return -2;
  }
  if (k == -1) return -1;
  if (k == 1 && on_ray(a, b, A)) return 1;
  return 0;
}
int in_a_row(pnt a, pnt b, pnt c) {
  double aoc = a ^ c, aob = a ^ b, boc = b ^ c;
  if (abs(aoc) < ep) {
    if (abs(aob) > ep || (a & b) < -ep) return -1;
    return 2;
  }
  if (aoc > 0 && aob > -ep && boc > -ep) return 1;
  if (aoc < 0 && aob < ep && boc < ep) return 1;
  return 0;
}
double T1 = -1, T2 = -1;
void update(double ans1, double ans2) {
  if (T1 == -1)
    T1 = ans1, T2 = ans2;
  else if (T1 < ans1 - ep)
    return;
  else if (T1 > ans1 + ep || T2 > ans2 + ep)
    T1 = ans1, T2 = ans2;
  return;
}
void calc(pnt X) {
  pnt P, Q;
  inter_line(A, K[0], X, X + U, P);
  inter_line(A, K[1], X, X + U, Q);
  double ans1 = P.dist() / V.dist();
  double ans2 = (Q - X).dist() / U.dist() * zu / f;
  update(ans1, ans2);
  return;
}
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) p[i].input();
  A.input();
  V.input();
  scanf("%lf", &zv);
  scanf("%lf", &f);
  f = -f;
  U.input();
  scanf("%lf", &zu);
  zu = -zu;
  K[0] = V;
  K[1] = V + U * zv / zu;
  for (int i = 0; i < n; i++) p[i] = p[i] - A;
  A = pnt(0, 0);
  p[n] = p[0];
  if (!(K[1] == A)) {
    pnt I[2];
    for (int i = 0; i < n; i++) {
      int k = inter_ray_seg(A, A + K[1], p[i], p[i + 1], I[0], I[1]);
      for (int i = 0; i < k; i++) {
        double t = I[i].dist() / K[1].dist();
        update(t, 0);
      }
    }
  }
  if (!(K[0] == A)) {
    pnt I[2];
    for (int i = 0; i < n; i++) {
      int k = inter_ray_seg(A, A + K[0], p[i], p[i + 1], I[0], I[1]);
      for (int j = 0; j < k; j++) {
        double t = I[j].dist() / K[0].dist();
        update(t, t * zv / f);
        if (U == A) update(t, 0);
      }
    }
  }
  if (abs(K[0] ^ K[1]) > ep) {
    pnt X, Y;
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < n; j++) {
        int k = inter_ray_seg(A, A + K[i], p[j], p[j + 1], X, Y);
        if (k == 1) C.push_back(X);
      }
    }
    for (int j = 0; j < n; j++)
      if (in_a_row(K[0], p[j], K[1]) > 0) C.push_back(p[j]);
    for (auto x : C) calc(x);
  }
  cout << fixed << setprecision(10) << T1 << " " << T2 << endl;
  return 0;
}