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>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int p[6];
int q[6];

long double f(long double x) {
    long double ret = 0;
    for(int i = 0; i < 6; i++) {
        long double a = x * p[i];
        long double b = (1 - x) * q[i];
        ret += max(a, b);
    }
    return ret / 100;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    for(int i = 0; i < 6; i++) cin >> p[i];
    for(int i = 0; i < 6; i++) cin >> q[i];
    long double ub = 1;
    long double lb = 0;
    for(int _ = 0; _ <= 1e6; _++) {
        long double u1 = (2 * ub + lb) / 3;
        long double l1 = (ub + 2 * lb) / 3;
        if(f(u1) > f(l1)) ub = u1;
        else lb = l1;
    }
    /*
    for(long double x = 0.1; x <= 1.0; x += 0.1) {
        cerr << x << " " << f(x) << endl;
    }
    */
    cout << fixed << setprecision(30) << f(ub) << endl;
    return 0;
}