Vasya plays the Plane of Tanks.

Tanks are described with the following attributes: 

  * the number of hit points; 
  * the interval between two gun shots (the time required to recharge the gun); 
  * the probability that the gun shot will not pierce armor of the enemy tank; 
  * the damage to the enemy's tank. 



The gun damage is described with a segment [l, r], where l and r are integer numbers. The potential gun damage x is chosen with equal probability among all integer numbers of the segment [l, r]. If the shot pierces the armor of an enemy's tank then the enemy loses x hit points. If the number of hit points becomes non-positive then the enemy tank is considered destroyed. 

It is possible that the shot does not pierce the armor of a tank. In this case the number of hit points doesn't change. The probability that the armor will not be pierced is considered as the shooting tank attribute and does not depend on players' behavior.

The victory is near and there is only one enemy tank left. Vasya is ready for the battle — one more battle between the Good and the Evil is inevitable! Two enemies saw each other and each of them fired a shot at the same moment... The last battle has begun! Help Vasya to determine what is the probability that he will win the battle by destroying the enemy tank? 

If both tanks are destroyed (after simultaneous shots), then Vasya is considered a winner. You can assume that each player fires a shot just after the gun recharge and each tank has infinite number of ammo.

Input

The first line contains five integer numbers separated with spaces describing Vasya's tank: the number of hit points hp (10 ≤ hp ≤ 200), the interval between two shots dt (1 ≤ dt ≤ 30), gun damage segment l and r (10 ≤ l ≤ r ≤ 100), the probability that the enemy's tank armor will not be pierced p (0 ≤ p ≤ 100) (percents).

The second line describes the tank of Vasya's enemy in the same format.

Output

Print the only number with absolute or relative error no more than 10 - 4 — probability of Vasya's victory.

Examples

Input

100 3 50 50 0
100 3 50 50 0


Output

1.000000


Input

100 3 50 50 0
100 2 48 50 0


Output

0.888889


Input

100 3 50 50 0
100 1 50 50 50


Output

0.500000

Note

In the first example both tanks are destroyed at once after the second shot. The probability of destroying the enemy tank is 1.

In the second example Vasya's enemy tank fires the second shot before Vasya's tank, but has no time for the third shot. In order to destroy Vasya's tank it is necessary to fire two shots with damage 50. The probability of that event is <image> = <image>. Otherwise, Vasya wins.

In the third example Vasya's enemy tank fires three shots with probability of armor piercing 0.5. In order to destroy Vasya's tank it is necessary that at least 2 of 3 shots pierce the armor of Vasya's tank. The probability of this event is 0.5.
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
int hp1, hp2;
int dt1, dt2;
int L1, R1;
int L2, R2;
double p1, p2;
double frac1, frac2;
const int MAXH = 200;
const int D = 5000;
double dp1[MAXH + 1][D + 1];
double dp2[MAXH + 1][D + 1];
double sum1[D + 1];
double sum2[D + 1];
void calcDp(int i, double dp[][D + 1], double p, double frac, int L, int R,
            double sum[]) {
  for (int j = 0; j <= MAXH; ++j) dp[j][i + 1] = 0.0;
  sum[i + 1] = 0;
  for (int j = 1; j <= MAXH; ++j) {
    if (dp[j][i] < eps) continue;
    int h = j - L;
    if (h < 0) h = 0;
    double mul = p * frac * dp[j][i];
    for (int k = L; k <= R; ++k) {
      dp[h][i + 1] += mul;
      if (h > 0) {
        sum[i + 1] += mul;
        --h;
      }
    }
    dp[j][i + 1] += (1.0 - p) * dp[j][i];
    sum[i + 1] += (1.0 - p) * dp[j][i];
  }
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(9);
  int tmp;
  cin >> hp1 >> dt1 >> L1 >> R1 >> tmp;
  p1 = 1.0 - double(tmp) / 100.0;
  if (tmp == 100) {
    cout << "0.0" << endl;
    return 0;
  }
  cin >> hp2 >> dt2 >> L2 >> R2 >> tmp;
  if (tmp == 100) {
    cout << "1.0" << endl;
    return 0;
  }
  p2 = 1.0 - double(tmp) / 100.0;
  frac1 = 1.0 / double(R1 - L1 + 1.0);
  frac2 = 1.0 / double(R2 - L2 + 1.0);
  for (int i = 0; i <= MAXH; ++i) {
    dp1[i][0] = 0.0;
    dp2[i][0] = 0.0;
  }
  sum1[0] = 1.0;
  sum2[0] = 1.0;
  dp1[hp1][0] = 1.0;
  dp2[hp2][0] = 1.0;
  for (int i = 0; i < D; ++i) {
    calcDp(i, dp2, p1, frac1, L1, R1, sum2);
    calcDp(i, dp1, p2, frac2, L2, R2, sum1);
  }
  int next1 = 0;
  int next2 = 0;
  int done1 = 0;
  int done2 = 0;
  double ret = 0.0;
  while (true) {
    if (next1 <= next2) {
      if (done1 >= D) break;
      double expr = sum1[done2] * dp2[0][done1 + 1];
      ret += expr;
      ++done1;
      next1 += dt1;
    } else {
      if (done2 >= D) break;
      ++done2;
      next2 += dt2;
    }
  }
  cout << ret << endl;
  return 0;
}
