Problem: Vasya plays the Power Defence. 

He must pass the last level of the game. In order to do this he must kill the Main Villain, who moves in a straight line at speed 1 meter per second from the point ( - ∞, 0) to the point ( + ∞, 0) of the game world. In the points (x, 1) and (x, - 1), where x is an integer number, Vasya can build towers of three types: fire-tower, electric-tower or freezing-tower. However, it is not allowed to build two towers at the same point. Towers of each type have a certain action radius and the value of damage per second (except freezing-tower). If at some point the Main Villain is in the range of action of k freezing towers then his speed is decreased by k + 1 times.

The allowed number of towers of each type is known. It is necessary to determine the maximum possible damage we can inflict on the Main Villain.

All distances in the problem are given in meters. The size of the Main Villain and the towers are so small, that they can be considered as points on the plane. The Main Villain is in the action radius of a tower if the distance between him and tower is less than or equal to the action radius of the tower.

Input

The first line contains three integer numbers nf, ne and ns — the maximum number of fire-towers, electric-towers and freezing-towers that can be built (0 ≤ nf, ne, ns ≤ 20, 1 ≤ nf + ne + ns ≤ 20). The numbers are separated with single spaces.

The second line contains three integer numbers rf, re and rs (1 ≤ rf, re, rs ≤ 1000) — the action radii of fire-towers, electric-towers and freezing-towers. The numbers are separated with single spaces.

The third line contains two integer numbers df and de (1 ≤ df, de ≤ 1000) — the damage a fire-tower and an electronic-tower can inflict on the Main Villain per second (in the case when the Main Villain is in the action radius of the tower). The numbers are separated with single space.

Output

Print the only real number — the maximum possible damage to the Main Villain with absolute or relative error not more than 10 - 6.

Examples

Input

1 0 0
10 10 10
100 100


Output

1989.97487421

Input

1 0 1
10 10 10
100 100


Output

3979.94974843

Note

In the first sample we've got one fire-tower that always inflicts the same damage, independently of its position. 

In the second sample we've got another freezing-tower of the same action radius. If we build the two towers opposite each other, then the Main Villain's speed will be two times lower, whenever he enters the fire-tower's action radius. That means that the enemy will be inflicted with twice more damage.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const double eps = 1e-9;
struct MinCostMaxFlow {
  static const int MAXV = 110;
  static const int INF = 1000000000;
  struct Edge {
    int v, cap;
    double w;
    int rev;
    Edge() {}
    Edge(int t2, int t3, double t4, int t5) : v(t2), cap(t3), w(t4), rev(t5) {}
  };
  int V, s, t;
  vector<Edge> g[MAXV];
  void init(int n) {
    V = n + 2;
    s = n + 1, t = n + 2;
    for (int i = 1; i <= V; i++) g[i].clear();
  }
  void addEdge(int a, int b, int cap, double w) {
    g[a].push_back(Edge(b, cap, w, (int)g[b].size()));
    g[b].push_back(Edge(a, 0, -w, (int)g[a].size() - 1));
  }
  double d[MAXV];
  int id[MAXV], mom[MAXV];
  bool inqu[MAXV];
  queue<int> qu;
  double solve() {
    int mxf = 0;
    double mnc = 0;
    while (1) {
      for (int i = 0; i <= V; i++) {
        d[i] = 1e9;
        inqu[i] = false;
        mom[i] = -1;
      }
      mom[s] = s;
      d[s] = 0;
      qu.push(s);
      inqu[s] = 1;
      while (qu.size()) {
        int u = qu.front();
        qu.pop();
        inqu[u] = 0;
        for (int i = 0; i < (int)g[u].size(); i++) {
          Edge &e = g[u][i];
          int v = e.v;
          if (e.cap > 0 && d[v] > d[u] + e.w + eps) {
            d[v] = d[u] + e.w;
            mom[v] = u;
            id[v] = i;
            if (!inqu[v]) {
              qu.push(v);
              inqu[v] = 1;
            }
          }
        }
      }
      if (mom[t] == -1) break;
      int df = INF;
      for (int u = t; u != s; u = mom[u]) df = min(df, g[mom[u]][id[u]].cap);
      for (int u = t; u != s; u = mom[u]) {
        Edge &e = g[mom[u]][id[u]];
        e.cap -= df;
        g[e.v][e.rev].cap += df;
      }
      mxf += df;
      mnc += df * d[t];
    }
    return mnc;
  }
} flow;
int nf, ne, ns;
int rf, re, rs;
int df, de;
double drf, dre, drs;
void init() {
  cin >> nf >> ne >> ns;
  cin >> rf >> re >> rs;
  cin >> df >> de;
  drf = sqrt(rf * rf - 1);
  dre = sqrt(re * re - 1);
  drs = sqrt(rs * rs - 1);
}
double ans;
int f[13 + 13];
pair<double, pair<int, int>> vv[99];
double score(int at, double r, int d) {
  int vt = 0;
  vv[vt++] = {at - r, {1, +d}};
  vv[vt++] = {at + r, {1, -d}};
  int tms = 1, dmg = 0;
  for (int i = 0; i < 13; i++) {
    if (f[i] == 0) continue;
    if (i + drs < at - r) continue;
    if (i - drs > at + r) continue;
    if (i - drs < at - r)
      tms += f[i];
    else {
      vv[vt++] = {i - drs, {0, +f[i]}};
    }
    if (i + drs < at + r) {
      vv[vt++] = {i + drs, {0, -f[i]}};
    }
  }
  sort(vv, vv + vt);
  double ret = 0;
  for (int i = 0; i + 1 < vt; i++) {
    double tint = vv[i + 1].first - vv[i].first;
    if (vv[i].second.first)
      dmg += vv[i].second.second;
    else
      tms += vv[i].second.second;
    ret += tint * dmg * tms;
  }
  return ret;
}
double dp[22][22];
inline int enc() {
  int ret1 = 0;
  for (int i = 0; i < 13; i++) ret1 = (ret1 << 2) | f[i];
  int ret2 = 0;
  for (int i = 13 - 1; i >= 0; i--) ret2 = (ret2 << 2) | f[i];
  return min(ret1, ret2);
}
unordered_set<int> vst;
void cal() {
  int r = enc();
  if (vst.find(r) != vst.end()) return;
  vst.insert(r);
  if (ns < 12) {
    flow.init(2 + 13);
    flow.addEdge(flow.s, 13 + 1, nf, 0);
    flow.addEdge(flow.s, 13 + 2, ne, 0);
    for (int i = 0; i < 13; i++) {
      if (f[i] == 2) continue;
      double scoref = score(i, drf, df);
      double scoree = score(i, dre, de);
      flow.addEdge(13 + 1, i + 1, 2 - f[i], -scoref);
      flow.addEdge(13 + 2, i + 1, 2 - f[i], -scoree);
      flow.addEdge(i + 1, flow.t, 2 - f[i], 0);
    }
    double tret = -flow.solve();
    ans = max(ans, tret);
    return;
  }
  vector<double> sf, se;
  for (int i = 0; i < 13; i++) {
    if (f[i] == 2) continue;
    double scoref = score(i, drf, df);
    double scoree = score(i, dre, de);
    for (int j = f[i]; j < 2; j++) {
      sf.push_back(scoref);
      se.push_back(scoree);
    }
  }
  sort(sf.begin(), sf.end(), greater<double>());
  sort(se.begin(), se.end(), greater<double>());
  for (int i = 0; i <= nf; i++)
    for (int j = 0; j <= ne; j++) dp[i][j] = 0.0;
  for (int i = 0; i <= nf; i++)
    for (int j = 0; j <= ne; j++) {
      int nxt = i + j;
      if (i < nf) dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + sf[nxt]);
      if (j < ne) dp[i][j + 1] = max(dp[i][j + 1], dp[i][j] + se[nxt]);
    }
  ans = max(ans, dp[nf][ne]);
}
void go(int now, int res) {
  if (now == 13) {
    if (res == 0) cal();
    return;
  }
  if ((13 - now) * 2 < res) return;
  for (int i = 0; i <= min(2, res); i++) {
    f[now] = i;
    go(now + 1, res - i);
  }
}
void solve() {
  go(0, ns);
  printf("%.12f\n", ans);
}
int main() {
  init();
  solve();
}