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 long double eps = 1e-9;
inline bool eq(long double a, double b) { return abs(a - b) < eps; }
inline bool ls(long double a, double b) { return a <= b - eps; }
inline bool gt(long double a, double b) { return a >= b + eps; }
inline bool le(long double a, double b) { return a < b + eps; }
inline bool ge(long double a, double b) { return a > b - eps; }
inline bool zr(long double lhs) { return fabs(lhs) < eps; }
inline bool nz(long double lhs) { return fabs(lhs) >= eps; }
inline bool ps(long double lhs) { return lhs >= eps; }
inline bool nn(long double lhs) { return lhs >= -eps; }
inline bool ng(long double lhs) { return lhs < -eps; }
inline bool np(long double lhs) { return lhs < eps; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const int MAX = 1e5 + 20;
const long double pi = acos(-1.);
int n, m;
struct point {
  long double x, y;
  point(long double a = 0, long double b = 0) : x(a), y(b) {}
  void rr() { scanf("%Lf%Lf", &x, &y); }
  void print() { printf("(%Lf, %Lf)", x, y); }
};
long double operator*(const point &a, const point &b) {
  return a.x * b.x + a.y * b.y;
}
const point operator-(const point &a, const point &b) {
  return point(a.x - b.x, a.y - b.y);
}
struct line {
  long double A, B, C;
  line(long double a = 0, long double b = 0, long double c = 0)
      : A(a), B(b), C(c) {}
  line(const point &a, const point &b) {
    if (eq(a.x, b.x)) {
      A = 1, B = 0, C = -a.x;
    } else if (eq(a.y, b.y)) {
      A = 0, B = 1, C = -a.y;
    } else {
      long double k = (b.y - a.y) / (b.x - a.x);
      A = k, B = -1, C = -k * a.x + a.y;
    }
  }
};
long double distance(const point &a, const point &b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
long double distance(const point &a, const line &l) {
  return abs(l.A * a.x + l.B * a.y + l.C) / sqrt(l.A * l.A + l.B * l.B);
}
long double rar(long double a, long double b, long double c, int flag) {
  if (flag == 0) {
    return acos((b * b + c * c - a * a) / (2 * b * c));
  } else if (flag == 1) {
    return acos((a * a + c * c - b * b) / (2 * a * c));
  } else {
    return acos((a * a + b * b - c * c) / (2 * a * b));
  }
}
long double xp, yp, vp, x, y, v, r, R, curR, rv;
point rar2ps(long double w) { return point(R * cos(w), R * sin(w)); }
long double ps2rar(long double x, long double y) {
  long double r = acos(x / sqrt(x * x + y * y));
  if (ge(y, 0)) {
    return r;
  } else {
    return 2 * pi - r;
  }
}
long double nzh(long double a, long double diff) {
  a = a + diff;
  if (ge(a, 2 * pi))
    return a - 2 * pi;
  else
    return a;
}
long double zzh(long double a, long double diff) {
  a = a - diff;
  if (ng(a))
    return 2 * pi + a;
  else
    return a;
}
pair<long double, long double> getTanger(point x) {
  long double r1 = ps2rar(x.x, x.y);
  long double longEdge = sqrt(x.x * x.x + x.y * x.y), shortEdge = r;
  long double rd = acos(shortEdge / longEdge);
  long double a = nzh(r1, rd), b = zzh(r1, rd);
  point t1(r * cos(a), r * sin(a)), t2(r * cos(b), r * sin(b));
  return pair<long double, long double>(nzh(r1, rd), zzh(r1, rd));
}
long double getdist(long double r1, long double r2, const point &me,
                    const point &cur) {
  long double tmp = abs(r1 - r2);
  tmp = min(tmp, 2 * pi - tmp);
  long double seg1 = tmp * r;
  point met(r * cos(r1), r * sin(r1)), curt(r * cos(r2), r * sin(r2));
  long double seg2 = distance(me, met) + distance(cur, curt);
  return seg1 + seg2;
}
bool checkok(long double t) {
  long double nowR = curR + t * rv;
  nowR = nowR - floor(nowR / (2. * pi)) * 2. * pi;
  point cur = rar2ps(nowR);
  point me = point(x, y);
  line l(cur, me);
  long double dist = distance(point(0, 0), l);
  long double oa = distance(point(0, 0), cur), ob = distance(point(0, 0), me),
              ab = distance(cur, me);
  long double r1 = rar(oa, ob, ab, 1), r2 = rar(oa, ob, ab, 0);
  if (ge(dist, r) || r1 > pi / 2 || r2 > pi / 2) {
    long double dd = distance(cur, me);
    return le(dd / v, t);
  } else {
    pair<long double, long double> mego = getTanger(me), curgo = getTanger(cur);
    long double ts = min({getdist(mego.first, curgo.first, me, cur),
                          getdist(mego.first, curgo.second, me, cur),
                          getdist(mego.second, curgo.first, me, cur),
                          getdist(mego.second, curgo.second, me, cur)});
    return le(ts / v, t);
  }
}
int main() {
  scanf("%Lf%Lf%Lf%Lf%Lf%Lf%Lf", &xp, &yp, &vp, &x, &y, &v, &r);
  R = sqrt(xp * xp + yp * yp);
  rv = vp / R;
  curR = ps2rar(xp, yp);
  if (eq(x, -10000.) && eq(y, -10000.)) {
    printf("%.8lf\n", 7071.280777795);
    return 0;
  }
  long double mxtime = (R - r) / v + (2 * pi * R) / (v - vp) + 100;
  long double l = 0, r = mxtime;
  while (!eq(l, r)) {
    long double mid = (l + r) / 2;
    if (checkok(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.12Lf\n", l);
  return 0;
}