Problem: Qwerty the Ranger arrived to the Diatar system with a very important task. He should deliver a special carcinogen for scientific research to planet Persephone. This is urgent, so Qwerty has to get to the planet as soon as possible. A lost day may fail negotiations as nobody is going to pay for an overdue carcinogen.

You can consider Qwerty's ship, the planet Persephone and the star Diatar points on a plane. Diatar is located in the origin of coordinate axes — at point (0, 0). Persephone goes round Diatar along a circular orbit with radius R in the counter-clockwise direction at constant linear speed vp (thus, for instance, a full circle around the star takes <image> of time). At the initial moment of time Persephone is located at point (xp, yp).

At the initial moment of time Qwerty's ship is at point (x, y). Qwerty can move in any direction at speed of at most v (v > vp). The star Diatar is hot (as all stars), so Qwerty can't get too close to it. The ship's metal sheathing melts at distance r (r < R) from the star.

Find the minimum time Qwerty needs to get the carcinogen to planet Persephone.

Input

The first line contains space-separated integers xp, yp and vp ( - 104 ≤ xp, yp ≤ 104, 1 ≤ vp < 104) — Persephone's initial position and the speed at which it goes round Diatar.

The second line contains space-separated integers x, y, v and r ( - 104 ≤ x, y ≤ 104, 1 < v ≤ 104, 1 ≤ r ≤ 104) — The intial position of Qwerty's ship, its maximum speed and the minimum safe distance to star Diatar.

It is guaranteed that r2 < x2 + y2, r2 < xp2 + yp2 and vp < v.

Output

Print a single real number — the minimum possible delivery time. The answer will be considered valid if its absolute or relative error does not exceed 10 - 6.

Examples

Input

10 0 1
-10 0 2 8


Output

9.584544103

Input

50 60 10
50 60 20 40


Output

0.000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1.0);
int dblcmp(double d) {
  if (fabs(d) < eps) return 0;
  return d > eps ? 1 : -1;
}
inline double sqr(double x) { return x * x; }
struct point {
  double x, y;
  point() {}
  point(double _x, double _y) : x(_x), y(_y){};
  void input() { scanf("%lf%lf", &x, &y); }
  void output() { printf("%.12f %.12f\n", x, y); }
  bool operator==(point a) const {
    return dblcmp(a.x - x) == 0 && dblcmp(a.y - y) == 0;
  }
  bool operator<(point a) const {
    return dblcmp(a.x - x) == 0 ? dblcmp(y - a.y) < 0 : x < a.x;
  }
  double len() { return hypot(x, y); }
  double len2() { return x * x + y * y; }
  double distance(point p) { return hypot(x - p.x, y - p.y); }
  point add(point p) { return point(x + p.x, y + p.y); }
  point sub(point p) { return point(x - p.x, y - p.y); }
  point mul(double b) { return point(x * b, y * b); }
  point div(double b) { return point(x / b, y / b); }
  double dot(point p) { return x * p.x + y * p.y; }
  double det(point p) { return x * p.y - y * p.x; }
  double rad(point a, point b) {
    point p = *this;
    double c = acos((a.sub(p).dot(b.sub(p))) / (a.distance(p) * b.distance(p)));
    return c;
  }
  point trunc(double r) {
    double l = len();
    if (!dblcmp(l)) return *this;
    r /= l;
    return point(x * r, y * r);
  }
  point rotleft() { return point(-y, x); }
  point rotright() { return point(y, -x); }
  point rotate(point p, double angle) {
    point v = this->sub(p);
    double c = cos(angle), s = sin(angle);
    return point(p.x + v.x * c - v.y * s, p.y + v.x * s + v.y * c);
  }
};
struct line {
  point a, b;
  line() {}
  line(point _a, point _b) {
    a = _a;
    b = _b;
  }
  bool operator==(line v) { return (a == v.a) && (b == v.b); }
  line(point p, double angle) {
    a = p;
    if (dblcmp(angle - pi / 2) == 0) {
      b = a.add(point(0, 1));
    } else {
      b = a.add(point(1, tan(angle)));
    }
  }
  line(double _a, double _b, double _c) {
    if (dblcmp(_a) == 0) {
      a = point(0, -_c / _b);
      b = point(1, -_c / _b);
    } else if (dblcmp(_b) == 0) {
      a = point(-_c / _a, 0);
      b = point(-_c / _a, 1);
    } else {
      a = point(0, -_c / _b);
      b = point(1, (-_c - _a) / _b);
    }
  }
  void input() {
    a.input();
    b.input();
  }
  void adjust() {
    if (b < a) swap(a, b);
  }
  double length() { return a.distance(b); }
  double angle() {
    double k = atan2(b.y - a.y, b.x - a.x);
    if (dblcmp(k) < 0) k += pi;
    if (dblcmp(k - pi) == 0) k -= pi;
    return k;
  }
  int relation(point p) {
    int c = dblcmp(p.sub(a).det(b.sub(a)));
    if (c < 0) return 1;
    if (c > 0) return 2;
    return 3;
  }
  bool pointonseg(point p) {
    return dblcmp(p.sub(a).det(b.sub(a))) == 0 &&
           dblcmp(p.sub(a).dot(p.sub(b))) <= 0;
  }
  bool parallel(line v) { return dblcmp(b.sub(a).det(v.b.sub(v.a))) == 0; }
  int segcrossseg(line v) {
    int d1 = dblcmp(b.sub(a).det(v.a.sub(a)));
    int d2 = dblcmp(b.sub(a).det(v.b.sub(a)));
    int d3 = dblcmp(v.b.sub(v.a).det(a.sub(v.a)));
    int d4 = dblcmp(v.b.sub(v.a).det(b.sub(v.a)));
    if ((d1 ^ d2) == -2 && (d3 ^ d4) == -2) return 2;
    return (d1 == 0 && dblcmp(v.a.sub(a).dot(v.a.sub(b))) <= 0 ||
            d2 == 0 && dblcmp(v.b.sub(a).dot(v.b.sub(b))) <= 0 ||
            d3 == 0 && dblcmp(a.sub(v.a).dot(a.sub(v.b))) <= 0 ||
            d4 == 0 && dblcmp(b.sub(v.a).dot(b.sub(v.b))) <= 0);
  }
  int linecrossseg(line v) {
    int d1 = dblcmp(b.sub(a).det(v.a.sub(a)));
    int d2 = dblcmp(b.sub(a).det(v.b.sub(a)));
    if ((d1 ^ d2) == -2) return 2;
    return (d1 == 0 || d2 == 0);
  }
  int linecrossline(line v) {
    if ((*this).parallel(v)) {
      return v.relation(a) == 3;
    }
    return 2;
  }
  point crosspoint(line v) {
    double a1 = v.b.sub(v.a).det(a.sub(v.a));
    double a2 = v.b.sub(v.a).det(b.sub(v.a));
    return point((a.x * a2 - b.x * a1) / (a2 - a1),
                 (a.y * a2 - b.y * a1) / (a2 - a1));
  }
  double dispointtoline(point p) {
    return fabs(p.sub(a).det(b.sub(a))) / length();
  }
  double dispointtoseg(point p) {
    if (dblcmp(p.sub(b).dot(a.sub(b))) < 0 ||
        dblcmp(p.sub(a).dot(b.sub(a))) < 0) {
      return min(p.distance(a), p.distance(b));
    }
    return dispointtoline(p);
  }
  point lineprog(point p) {
    return a.add(b.sub(a).mul(b.sub(a).dot(p.sub(a)) / b.sub(a).len2()));
  }
  point symmetrypoint(point p) {
    point q = lineprog(p);
    return point(2 * q.x - p.x, 2 * q.y - p.y);
  }
};
struct circle {
  point p;
  double r;
  circle() {}
  circle(point _p, double _r) : p(_p), r(_r){};
  circle(double x, double y, double _r) : p(point(x, y)), r(_r){};
  circle(point a, point b, point c) {
    p = line(a.add(b).div(2), a.add(b).div(2).add(b.sub(a).rotleft()))
            .crosspoint(
                line(c.add(b).div(2), c.add(b).div(2).add(b.sub(c).rotleft())));
    r = p.distance(a);
  }
  circle(point a, point b, point c, bool t) {
    line u, v;
    double m = atan2(b.y - a.y, b.x - a.x), n = atan2(c.y - a.y, c.x - a.x);
    u.a = a;
    u.b = u.a.add(point(cos((n + m) / 2), sin((n + m) / 2)));
    v.a = b;
    m = atan2(a.y - b.y, a.x - b.x), n = atan2(c.y - b.y, c.x - b.x);
    v.b = v.a.add(point(cos((n + m) / 2), sin((n + m) / 2)));
    p = u.crosspoint(v);
    r = line(a, b).dispointtoseg(p);
  }
  void input() {
    p.input();
    scanf("%lf", &r);
  }
  void output() { printf("%.2lf %.2lf %.2lf\n", p.x, p.y, r); }
  bool operator==(circle v) { return ((p == v.p) && dblcmp(r - v.r) == 0); }
  bool operator<(circle v) const {
    return ((p < v.p) || (p == v.p) && dblcmp(r - v.r) < 0);
  }
  double area() { return pi * sqr(r); }
  double circumference() { return 2 * pi * r; }
  int relation(point b) {
    double dst = b.distance(p);
    if (dblcmp(dst - r) < 0) return 2;
    if (dblcmp(dst - r) == 0) return 1;
    return 0;
  }
  int relationseg(line v) {
    double dst = v.dispointtoseg(p);
    if (dblcmp(dst - r) < 0) return 2;
    if (dblcmp(dst - r) == 0) return 1;
    return 0;
  }
  int relationline(line v) {
    double dst = v.dispointtoline(p);
    printf("==%lf %lf\n", dst, r);
    if (dblcmp(dst - r) < 0) return 2;
    if (dblcmp(dst - r) == 0) return 1;
    puts("--");
    return 0;
  }
  int getcircle(point a, point b, double r, circle &c1, circle &c2) {
    circle x(a, r), y(b, r);
    int t = x.pointcrosscircle(y, c1.p, c2.p);
    if (!t) return 0;
    c1.r = c2.r = r;
    return t;
  }
  int getcircle(line u, point q, double r1, circle &c1, circle &c2) {
    double dis = u.dispointtoline(q);
    if (dblcmp(dis - r1 * 2) > 0) return 0;
    if (dblcmp(dis) == 0) {
      c1.p = q.add(u.b.sub(u.a).rotleft().trunc(r1));
      c2.p = q.add(u.b.sub(u.a).rotright().trunc(r1));
      c1.r = c2.r = r1;
      return 2;
    }
    line u1 = line(u.a.add(u.b.sub(u.a).rotleft().trunc(r1)),
                   u.b.add(u.b.sub(u.a).rotleft().trunc(r1)));
    line u2 = line(u.a.add(u.b.sub(u.a).rotright().trunc(r1)),
                   u.b.add(u.b.sub(u.a).rotright().trunc(r1)));
    circle cc = circle(q, r1);
    point p1, p2;
    if (!cc.pointcrossline(u1, p1, p2)) cc.pointcrossline(u2, p1, p2);
    c1 = circle(p1, r1);
    if (p1 == p2) {
      c2 = c1;
      return 1;
    }
    c2 = circle(p2, r1);
    return 2;
  }
  int getcircle(line u, line v, double r1, circle &c1, circle &c2, circle &c3,
                circle &c4) {
    if (u.parallel(v)) return 0;
    line u1 = line(u.a.add(u.b.sub(u.a).rotleft().trunc(r1)),
                   u.b.add(u.b.sub(u.a).rotleft().trunc(r1)));
    line u2 = line(u.a.add(u.b.sub(u.a).rotright().trunc(r1)),
                   u.b.add(u.b.sub(u.a).rotright().trunc(r1)));
    line v1 = line(v.a.add(v.b.sub(v.a).rotleft().trunc(r1)),
                   v.b.add(v.b.sub(v.a).rotleft().trunc(r1)));
    line v2 = line(v.a.add(v.b.sub(v.a).rotright().trunc(r1)),
                   v.b.add(v.b.sub(v.a).rotright().trunc(r1)));
    c1.r = c2.r = c3.r = c4.r = r1;
    c1.p = u1.crosspoint(v1);
    c2.p = u1.crosspoint(v2);
    c3.p = u2.crosspoint(v1);
    c4.p = u2.crosspoint(v2);
    return 4;
  }
  int getcircle(circle cx, circle cy, double r1, circle &c1, circle &c2) {
    circle x(cx.p, r1 + cx.r), y(cy.p, r1 + cy.r);
    int t = x.pointcrosscircle(y, c1.p, c2.p);
    if (!t) return 0;
    c1.r = c2.r = r1;
    return t;
  }
  int pointcrossline(line v, point &p1, point &p2) {
    if (!(*this).relationseg(v)) return 0;
    point a = v.lineprog(p);
    double d = v.dispointtoline(p);
    d = sqrt(r * r - d * d);
    if (dblcmp(d) == 0) {
      p1 = a;
      p2 = a;
      return 1;
    }
    p1 = a.sub(v.b.sub(v.a).trunc(d));
    p2 = a.add(v.b.sub(v.a).trunc(d));
    return 2;
  }
  int relationcircle(circle v) {
    double d = p.distance(v.p);
    if (dblcmp(d - r - v.r) > 0) return 5;
    if (dblcmp(d - r - v.r) == 0) return 4;
    double l = fabs(r - v.r);
    if (dblcmp(d - r - v.r) < 0 && dblcmp(d - l) > 0) return 3;
    if (dblcmp(d - l) == 0) return 2;
    if (dblcmp(d - l) < 0) return 1;
  }
  int pointcrosscircle(circle v, point &p1, point &p2) {
    int rel = relationcircle(v);
    if (rel == 1 || rel == 5) return 0;
    double d = p.distance(v.p);
    double l = (d + (sqr(r) - sqr(v.r)) / d) / 2;
    double h = sqrt(sqr(r) - sqr(l));
    p1 = p.add(v.p.sub(p).trunc(l).add(v.p.sub(p).rotleft().trunc(h)));
    p2 = p.add(v.p.sub(p).trunc(l).add(v.p.sub(p).rotright().trunc(h)));
    if (rel == 2 || rel == 4) {
      return 1;
    }
    return 2;
  }
  int tangentline(point q, line &u, line &v) {
    int x = relation(q);
    if (x == 2) return 0;
    if (x == 1) {
      u = line(q, q.add(q.sub(p).rotleft()));
      v = u;
      return 1;
    }
    double d = p.distance(q);
    double l = sqr(r) / d;
    double h = sqrt(sqr(r) - sqr(l));
    u = line(q, p.add(q.sub(p).trunc(l).add(q.sub(p).rotleft().trunc(h))));
    v = line(q, p.add(q.sub(p).trunc(l).add(q.sub(p).rotright().trunc(h))));
    return 2;
  }
  double areacircle(circle v) {
    int rel = relationcircle(v);
    if (rel >= 4) return 0.0;
    if (rel <= 2) return min(area(), v.area());
    double d = p.distance(v.p);
    double hf = (r + v.r + d) / 2.0;
    double ss = 2 * sqrt(hf * (hf - r) * (hf - v.r) * (hf - d));
    double a1 = acos((r * r + d * d - v.r * v.r) / (2.0 * r * d));
    a1 = a1 * r * r;
    double a2 = acos((v.r * v.r + d * d - r * r) / (2.0 * v.r * d));
    a2 = a2 * v.r * v.r;
    return a1 + a2 - ss;
  }
  double areatriangle(point a, point b) {
    if (dblcmp(p.sub(a).det(p.sub(b)) == 0)) return 0.0;
    point q[5];
    int len = 0;
    q[len++] = a;
    line l(a, b);
    point p1, p2;
    if (pointcrossline(l, q[1], q[2]) == 2) {
      if (dblcmp(a.sub(q[1]).dot(b.sub(q[1]))) < 0) q[len++] = q[1];
      if (dblcmp(a.sub(q[2]).dot(b.sub(q[2]))) < 0) q[len++] = q[2];
    }
    q[len++] = b;
    if (len == 4 && (dblcmp(q[0].sub(q[1]).dot(q[2].sub(q[1]))) > 0))
      swap(q[1], q[2]);
    double res = 0;
    int i;
    for (i = 0; i < len - 1; i++) {
      if (relation(q[i]) == 0 || relation(q[i + 1]) == 0) {
        double arg = p.rad(q[i], q[i + 1]);
        res += r * r * arg / 2.0;
      } else {
        res += fabs(q[i].sub(p).det(q[i + 1].sub(p)) / 2.0);
      }
    }
    return res;
  }
};
double xp, yp, vp;
double x, y, v, r;
circle c;
double dist(point a, point b) {
  line l(a, b);
  point p11, p12;
  if (!c.pointcrossline(l, p11, p12)) return a.distance(b);
  double rd = point(0, 0).rad(p11, p12);
  rd = min(rd, 2 * pi - rd);
  double ds = a.distance(b) - p11.distance(p12) + rd * r;
  line l1, l2;
  c.tangentline(a, l1, l2);
  point p1[3];
  p1[0] = l1.b;
  p1[1] = l2.b;
  c.tangentline(b, l1, l2);
  point p2[3];
  p2[0] = l1.b;
  p2[1] = l2.b;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      ds = min(ds, a.distance(p1[i]) + point(0, 0).rad(p1[i], p2[j]) * r +
                       b.distance(p2[j]));
    }
  }
  return ds;
}
int main() {
  cin >> xp >> yp >> vp;
  point p(xp, yp);
  cin >> x >> y >> v >> r;
  c = circle(0, 0, r);
  double d = 2 * pi * p.distance(point(0, 0));
  int i, j, k = 1000;
  double low = 0, high = 1e6;
  while (k--) {
    double mid = (low + high) / 2.0;
    double s = vp * mid;
    double w = fmod(s, d);
    w = (w / d) * 2 * pi;
    point where = p.rotate(point(0, 0), w);
    double md = dist(where, point(x, y));
    if (dblcmp(mid * v - md) >= 0) {
      high = mid;
    } else {
      low = mid;
    }
  }
  printf("%.12lf\n", low);
  return 0;
}