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>
using namespace std;
const double Eps = 1e-8;
double ans = 0;
int n1, n2, n3;
double r1, r2, r3;
double d1, d2;
double l1, l2, l3;
int n, m;
double w[100];
int c1[15][2];
int c2[15][2];
int c3[15][2];
int A1[100], D1[100];
int A2[100], D2[100];
int A3[100], D3[100];
void input() {
  cin >> n1 >> n2 >> n3;
  cin >> r1 >> r2 >> r3;
  cin >> d1 >> d2;
}
double caln() {
  double ret = 0;
  int now1 = 0, now2 = 0, now3 = 0;
  for (int i = 0; i + 1 < m; i++) {
    now1 += A1[i];
    now2 += A2[i];
    now3 += A3[i];
    now1 -= D1[i];
    now2 -= D2[i];
    now3 -= D3[i];
    double T = (w[i + 1] - w[i]) * (now3 + 1);
    ret += T * (d1 * now1 + d2 * now2);
  }
  return ret;
}
void search(int i, int last, int rest1, int rest2, int rest3) {
  if (i == n) {
    ans = max(ans, caln());
    return;
  }
  if (rest1 > 0 && (i % 2 == 0 || last <= 1)) {
    A1[c1[i / 2][0]]++, D1[c1[i / 2][1]]++;
    search(i + 1, 1, rest1 - 1, rest2, rest3);
    A1[c1[i / 2][0]]--, D1[c1[i / 2][1]]--;
  }
  if (rest2 > 0 && (i % 2 == 0 || last <= 2)) {
    A2[c2[i / 2][0]]++, D2[c2[i / 2][1]]++;
    search(i + 1, 2, rest1, rest2 - 1, rest3);
    A2[c2[i / 2][0]]--, D2[c2[i / 2][1]]--;
  }
  if (rest3 > 0) {
    A3[c3[i / 2][0]]++, D3[c3[i / 2][1]]++;
    search(i + 1, 3, rest1, rest2, rest3 - 1);
    A3[c3[i / 2][0]]--, D3[c3[i / 2][1]]--;
  }
}
void solve() {
  l1 = sqrt(r1 * r1 - 1);
  l2 = sqrt(r2 * r2 - 1);
  l3 = sqrt(r3 * r3 - 1);
  n = n1 + n2 + n3;
  for (int i = 0; i < (n + 1) / 2; i++) {
    w[m++] = (double)i - l1;
    w[m++] = (double)i + l1;
    w[m++] = (double)i - l2;
    w[m++] = (double)i + l2;
    w[m++] = (double)i - l3;
    w[m++] = (double)i + l3;
  }
  sort(w, w + m);
  for (int i = 0; i < (n + 1) / 2; i++)
    for (int j = 0; j < m; j++) {
      if (fabs((double)i - l1 - w[j]) < Eps) c1[i][0] = j;
      if (fabs((double)i + l1 - w[j]) < Eps) c1[i][1] = j;
      if (fabs((double)i - l2 - w[j]) < Eps) c2[i][0] = j;
      if (fabs((double)i + l2 - w[j]) < Eps) c2[i][1] = j;
      if (fabs((double)i - l3 - w[j]) < Eps) c3[i][0] = j;
      if (fabs((double)i + l3 - w[j]) < Eps) c3[i][1] = j;
    }
  search(0, 1, n1, n2, n3);
  printf("%.8lf", ans);
}
int main() {
  input();
  solve();
  return 0;
}