Problem: There are two (6-sided) dice: a red die and a blue die. When a red die is rolled, it shows i with probability p_i percents, and when a blue die is rolled, it shows j with probability q_j percents.

Petr and tourist are playing the following game. Both players know the probabilistic distributions of the two dice. First, Petr chooses a die in his will (without showing it to tourist), rolls it, and tells tourist the number it shows. Then, tourist guesses the color of the chosen die. If he guesses the color correctly, tourist wins. Otherwise Petr wins.

If both players play optimally, what is the probability that tourist wins the game?

Constraints

* 0 ≤ p_i, q_i ≤ 100
* p_1 + ... + p_6 = q_1 + ... + q_6 = 100
* All values in the input are integers.

Input

The input is given from Standard Input in the following format:


p_1 p_2 p_3 p_4 p_5 p_6
q_1 q_2 q_3 q_4 q_5 q_6


Output

Print the probability that tourist wins. The absolute error or the relative error must be at most 10^{-9}.

Examples

Input

25 25 25 25 0 0
0 0 0 0 50 50


Output

1.000000000000


Input

10 20 20 10 20 20
20 20 20 10 10 20


Output

0.550000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define rep(i, n) for (rint i = 1; i <= (n); i ++)
#define re0(i, n) for (rint i = 0; i < (int) n; i ++)
#define travel(i, u) for (rint i = head[u]; i; i = e[i].nxt)
#define rint register int
using namespace std;
 
template<typename tp> inline void read(tp &x) {
  x = 0; char c = getchar(); int f = 0;
  for (; c < '0' || c > '9'; f |= c == '-', c = getchar());
  for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if (f) x = -x;
}
#define db double
db a[233], b[233];
db cal(db x) {
  db ans = 0.0;
  rep (i, 6)
    ans += max(a[i] * x, b[i] * (1.0 - x));
  return ans;       
}

int main(void) {
  rep (i, 6) cin >> a[i], a[i] /= 100.0;
  rep (i, 6) cin >> b[i], b[i] /= 100.0;
  db l = 0.0, r = 1.0;
  rep (_, 100) {
    db lc = l + (r - l) / 3.0;
    db rc = l + (r - l) / 3.0 * 2.0;
    if (cal(lc) < cal(rc)) r = rc;
    else l = lc;
  }
  printf("%.10f\n", cal(r));
}