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>
const double EPS = 1e-9;
struct point3d {
  double x, y, z;
  point3d(double a, double b, double c) : x(a), y(b), z(c) {}
  point3d(double a, double b) : x(a), y(b), z(0) {}
  point3d(void) : x(0), y(0), z(0) {}
  point3d operator-(const point3d& o) const {
    return point3d(x - o.x, y - o.y, z - o.z);
  }
  point3d operator*(double o) const { return point3d(o * x, o * y, o * z); }
  double cross(const point3d& o) const { return x * o.y - o.x * y; }
};
struct segment {
  point3d p0, p1, u;
  segment(point3d& a, point3d& b) : p0(a), p1(b), u(b - a) {}
};
struct polygon {
  int n_points;
  std::vector<point3d> points;
  polygon(void) : n_points(0) {}
  point3d& operator[](int i) { return points[i]; }
};
struct ray {
  point3d v;
  ray(void) {}
  ray(point3d a) : v(a) {}
  double intersect(point3d& p) {
    double point_t;
    if (fabs(v.cross(p)) < EPS) {
      point_t = p.x / (double)v.x;
      if (point_t < -EPS || point_t > 1 + EPS) {
        return INFINITY;
      }
      return point_t;
    }
    return INFINITY;
  }
  double intersect(segment&& s) {
    const point3d& u = s.u;
    const point3d& w = s.p0;
    double det, ray_t, segment_t;
    det = v.cross(u);
    if (fabs(det) < EPS) {
      return std::min(intersect(s.p0), intersect(s.p1));
    }
    ray_t = w.cross(u) / det;
    segment_t = w.cross(v) / det;
    if (ray_t < -EPS || segment_t < -EPS || segment_t > 1 + EPS) {
      return INFINITY;
    }
    return ray_t;
  }
  double intersect(polygon& p) {
    int i;
    double min_t;
    min_t = INFINITY;
    for (i = 0; i < p.n_points; ++i) {
      min_t = std::min(min_t, intersect(segment(p[i], p[i + 1])));
    }
    return min_t;
  }
  bool is_parallel(ray& o) { return fabs(v.cross(o.v)) < EPS; }
};
std::pair<double, double> ray_time(ray& free_fall, ray& parachute,
                                   polygon& fence, int g) {
  double free_fall_t, parachute_t, aux_t;
  free_fall_t = free_fall.intersect(fence);
  parachute_t = parachute.intersect(fence);
  if (free_fall_t < parachute_t) {
    aux_t = -free_fall.v.z * free_fall_t / (double)g;
    return std::make_pair(free_fall_t, aux_t);
  }
  return std::make_pair(parachute_t, 0);
}
std::pair<double, double> vertex_time(point3d& vertex, point3d& plane,
                                      point3d& wind, int g) {
  double A, B, C, D, det;
  std::pair<double, double> ans;
  A = plane.x - plane.z * wind.x / (double)wind.z;
  B = -g * wind.x / (double)wind.z;
  C = plane.y - plane.z * wind.y / (double)wind.z;
  D = -g * wind.y / (double)wind.z;
  det = A * D - B * C;
  ans.first = (vertex.x * D - B * vertex.y) / det;
  ans.second = (A * vertex.y - vertex.x * C) / det;
  if (ans.first < -EPS || ans.second < -EPS ||
      plane.z * ans.first + g * ans.second < -EPS) {
    return std::make_pair(INFINITY, INFINITY);
  }
  return ans;
}
int main(void) {
  int i, g;
  polygon fence;
  point3d origin, plane, wind;
  ray free_fall, parachute_fall;
  std::pair<double, double> best_t;
  std::cin >> fence.n_points;
  fence.points.resize(fence.n_points + 1);
  for (i = 0; i < fence.n_points; ++i) {
    std::cin >> fence[i].x >> fence[i].y;
  }
  fence[fence.n_points] = fence[0];
  std::cin >> origin.x >> origin.y;
  std::cin >> plane.x >> plane.y >> plane.z;
  std::cin >> g;
  std::cin >> wind.x >> wind.y >> wind.z;
  for (i = 0; i <= fence.n_points; ++i) {
    fence[i].x -= origin.x;
    fence[i].y -= origin.y;
  }
  free_fall = ray(plane);
  parachute_fall = ray(plane - wind * (plane.z / (double)wind.z));
  best_t = ray_time(free_fall, parachute_fall, fence, g);
  if (!free_fall.is_parallel(parachute_fall)) {
    for (point3d& p : fence.points) {
      best_t = std::min(best_t, vertex_time(p, plane, wind, g));
    }
  }
  if (best_t.first == INFINITY || best_t.second == INFINITY) {
    std::cout << "-1 -1" << std::endl;
    return 0;
  }
  std::cout << std::fixed << std::setprecision(10) << best_t.first << " "
            << best_t.second << std::endl;
  return 0;
}