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 JAVA):

Solution:
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

//https://codeforces.com/contest/42/problem/A
//Difficulty: 1400
//Tags: greedy, implementation
public class CodeForce_GuiltyToTheKitchen {

	public static void main(String[] args) {
		int n = ni(), V = ni();
		notUsingDataStructure(n, V);
	}

	static DecimalFormat df = new DecimalFormat("####0.0###");

	static void notUsingDataStructure(int n, int V) {
		int sum = 0;
		int[] percent = new int[n];
		for (int i = 0; i < n; i++) {
			sum += percent[i] = ni();
		}
		double rateMin = Integer.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			rateMin = Math.min(rateMin, (double) ni() / percent[i]);
		}
		double res = rateMin * sum;
		if (res > V)
			res = V;
		System.out.println(df.format(res));

	}

	static void usingDataStructure(int n, int V) {
		int sum = 0;
		Ingredient[] ingredients = new Ingredient[n];
		for (int i = 0; i < n; i++) {
			int percent = ni();
			sum += percent;
			ingredients[i] = new Ingredient(percent);
		}
		double rateMin = Integer.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			ingredients[i].addLiter(ni());
			rateMin = Math.min(rateMin, ingredients[i].rate);
		}
		double res = rateMin * sum;
		if (res > V)
			res = V;
		System.out.println(df.format(res));
	}

	static class Ingredient {
		int percent;
		int litersHaving;
		double rate;

		public Ingredient(int percent) {
			super();
			this.percent = percent;
		}

		public void addLiter(int t) {
			this.litersHaving = t;
			rate = (double) litersHaving / percent;
		}

	}

	static InputStream is = System.in;
	static byte[] inbuf = new byte[1 << 24];
	static int lenbuf = 0, ptrbuf = 0;

	static int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	static boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	static int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	static double nd() {
		return Double.parseDouble(ns());
	}

	static char nc() {
		return (char) skip();
	}

	static String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	static char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	static int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	static long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

}