有罪——去厨房!AI (CI翻译)
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
litres (thus, there should be $*a*_{1} ·*x*, ..., *a*_{*n*} ·*x*$ litres of corresponding ingredients mixed for some non-negative $*x*$). In the kitchen Volodya found out that he has $*b*_{1}, ..., *b*_{*n*}$ 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?
按照罗宋汤的配方,它由 $*n*$ 种食材组成,各种食材必须按比例
混合(也就是说,对于某个非负数 $*x*$,应分别混合 $*a*_{1} ·*x*, ..., *a*_{*n*} ·*x*$ 升对应食材)。Volodya 在厨房里发现,他分别有 $*b*_{1}, ..., *b*_{*n*}$ 升这些食材。为了弥补代数上的错误,他应当尽可能多地煮汤,但锅的容量为 $*V*$ 升(也就是说,煮出的汤量可以在 $0$ 到 $*V*$ 升之间)。最终 Volodya 会煮出多少升罗宋汤?AI (CI翻译)
Input
输入格式
AI (CI翻译)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 $*a*_{*i*}$ ($1 ≤ *a*_{*i*} ≤ 100$). Finally, the last line contains $*n*$ space-separated integers $*b*_{*i*}$ ($0 ≤ *b*_{*i*} ≤ 100$).
输入的第一行包含两个以空格分隔的整数 $*n*$ 和 $*V*$($1 ≤ *n* ≤ 20, 1 ≤ *V* ≤ 10000$)。第二行包含 $*n*$ 个以空格分隔的整数 $*a*_{*i*}$($1 ≤ *a*_{*i*} ≤ 100$)。最后一行包含 $*n*$ 个以空格分隔的整数 $*b*_{*i*}$($0 ≤ *b*_{*i*} ≤ 100$)。AI (CI翻译)
Output
输出格式
AI (CI翻译)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}$.
程序应仅输出一个实数,即 Volodya 将煮出的汤的体积。答案的相对误差或绝对误差必须小于 $10^{ - 4}$。
AI (CI翻译)
样例
1 100
1
40
40.0
2 100
1 1
25 30
50.0
2 100
1 1
60 60
100.0
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。