Problem: It's a very unfortunate day for Volodya today. He got bad mark in algebra and was therefore forced to do some work in the kitchen, namely to cook borscht (traditional Russian soup). This should also improve his algebra skills.

According to the borscht recipe it consists of n ingredients that have to be mixed in proportion <image> litres (thus, there should be a1 ·x, ..., an ·x litres of corresponding ingredients mixed for some non-negative x). In the kitchen Volodya found out that he has b1, ..., bn litres of these ingredients at his disposal correspondingly. In order to correct his algebra mistakes he ought to cook as much soup as possible in a V litres volume pan (which means the amount of soup cooked can be between 0 and V litres). What is the volume of borscht Volodya will cook ultimately?

Input

The first line of the input contains two space-separated integers n and V (1 ≤ n ≤ 20, 1 ≤ V ≤ 10000). The next line contains n space-separated integers ai (1 ≤ ai ≤ 100). Finally, the last line contains n space-separated integers bi (0 ≤ bi ≤ 100).

Output

Your program should output just one real number — the volume of soup that Volodya will cook. Your answer must have a relative or absolute error less than 10 - 4.

Examples

Input

1 100
1
40


Output

40.0


Input

2 100
1 1
25 30


Output

50.0


Input

2 100
1 1
60 60


Output

100.0

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int isprime[2000001];
long long spf[2000001];
void seive() {
  spf[1] = 1;
  long long n = 2000000;
  memset(isprime, 1, sizeof(isprime));
  ;
  for (long long i = 2; i <= n; i++) spf[i] = i;
  for (long long i = 4; i <= n; i += 2) {
    spf[i] = 2;
    isprime[i] = 0;
  }
  for (long long i = 3; i <= n; i += 2) {
    if (isprime[i])
      for (long long j = i * i; j <= n; j += 2 * i) {
        isprime[j] = 0;
        if (spf[j] == j) spf[j] = i;
      }
  }
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second < b.second;
}
long long ex(long long n, long long ans) {
  if (n == 1)
    return ans;
  else if (n % 2)
    return (ans % ((1000000007)) * ex(n / 2, (ans * ans) % (1000000007))) %
           (1000000007);
  else
    return ex(n / 2, (ans * ans) % (1000000007));
}
long long kmp(string x, long long m) {
  vector<long long> pi(m, 0);
  pi[0] = 0;
  long long j = 0;
  for (long long i = 1; i < m; i++) {
    j = pi[i - 1];
    while (j > 0 && x[i] != x[j]) j = pi[j - 1];
    if (x[j] == x[i]) j++;
    pi[i] = j;
  }
  return j;
}
string kmp1(string x, long long m) {
  vector<long long> pi(m, 0);
  pi[0] = 0;
  long long ma = 0;
  long long j = 0;
  long long pos = 0;
  for (long long i = 1; i < m; i++) {
    j = pi[i - 1];
    while (j > 0 && x[i] != x[j]) j = pi[j - 1];
    if (x[j] == x[i]) j++;
    pi[i] = j;
    if (x[i] == '#') pos = i;
  }
  long long p = pos;
  for (long long i = (pos); i < (m); ++i) {
    if (pi[i] > ma) {
      ma = pi[i];
      p = i;
    }
  }
  return x.substr(p - ma + 1, ma);
}
void dfs(vector<long long> adj[], long long i, long long fl[]) {
  fl[1] = 1;
  fl[i] = 1;
  for (long long j = (0); j < (adj[i].size()); ++j) {
    if (!fl[adj[i][j]]) {
      dfs(adj, adj[i][j], fl);
    }
  }
}
int isp(long long x) {
  for (long long i = 2; i * i <= x; i++)
    if (x % i == 0) return 0;
  return 1;
}
struct Compare {
  bool operator()(long long const& p1, long long const& p2) {
    if (p1 < p2) {
      return true;
    }
    return false;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t1 = 1;
  seive();
  while (t1--) {
    long long n;
    double v;
    cin >> n >> v;
    double a[n], b[n];
    for (long long i = (0); i < (n); ++i) cin >> a[i];
    for (long long i = (0); i < (n); ++i) cin >> b[i];
    double mi = 1000000007.0;
    for (long long i = (0); i < (n); ++i) mi = min(mi, b[i] / a[i]);
    double ans = 0;
    for (long long i = (0); i < (n); ++i) ans += mi * (a[i]);
    if (ans > v) {
      ans = 0;
      double s = 0;
      for (long long i = (0); i < (n); ++i) s += a[i];
      mi = v / s;
      for (long long i = (0); i < (n); ++i) ans += mi * (a[i]);
    }
    cout << fixed << setprecision(6) << ans;
  }
}