日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 互聯網 > Codeforces Round #107 (Div. 2)---A. Soft Drinking

Codeforces Round #107 (Div. 2)---A. Soft Drinking

來源:程序員人生   發布時間:2014-11-10 08:42:52 閱讀次數:2725次

Soft Drinking
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

This winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has l milliliters of the drink. Also they bought c limes and cut each of them into d slices. After that they found p grams of salt.

To make a toast, each friend needs nl milliliters of the drink, a slice of lime and np grams of salt. The friends want to make as many toasts as they can, provided they all drink the same amount. How many toasts can each friend make?

Input

The first and only line contains positive integers nklcdpnlnp, not exceeding 1000 and no less than 1. The numbers are separated by exactly one space.

Output

Print a single integer ― the number of toasts each friend can make.

Sample test(s)
input
3 4 5 10 8 100 3 1
output
2
input
5 100 10 1 19 90 4 3
output
3
input
10 1000 1000 25 23 1 50 1
output
0
Note

A comment to the first sample:

Overall the friends have 4?*?5?=?20 milliliters of the drink, it is enough to make 20?/?3?=?6 toasts. The limes are enough for 10?*?8?=?80toasts and the salt is enough for 100?/?1?=?100 toasts. However, there are 3 friends in the group, so the answer is min(6,?80,?100)?/?3?=?2.







解題思路:貪心。不過是小學數學題。。。算出3種成份的最大值,取其中的最小值便可。






AC代碼:

#include <iostream> #include <cstring> #include <cstdio> using namespace std; int main(){ // freopen("in.txt", "r", stdin); int n,k,l,c,d,p,nl,np; while(cin>>n>>k>>l>>c>>d>>p>>nl>>np){ int a = (k * l) / nl; int aa = p / np; int aaa = c * d; int ans = min(a, min(aa, aaa)) / n; cout<<ans<<endl; } }



生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 午夜精品久久久久久毛片 | 97久久人人超碰caoprom欧美 | 91午夜视频 | 国产综合一区二区 | 91精品国产综合久久久久久 | 欧美激情中文字幕 | 欧美精品一区二区三区四区五区 | 久久久久成人精品 | 91精品成人久久 | 国产精品免费观看 | 日韩精品免费一区二区三区 | 亚洲电影免费观看 | 麻豆精品国产传媒mv男同 | 综合激情婷婷 | 免费一区二区视频 | 亚洲成a | 亚洲一区二区在线视频 | 久久久亚洲欧洲 | 伊人久久视频 | 国产第二区 | 国产超级av在线 | 日韩在线视频一区二区三区 | 日韩精品久久久 | 中文字幕区一区二 | 在线a视频网站 | 国产精品欧美激情 | 精品国产aⅴ | 亚洲欧美国产精品 | 欧美午夜一区二区三区 | 国产日韩精品视频一区二区三区 | 99国产精品99久久久久久 | 91精品久久久久久久久 | 国产一区二区色 | 97视频在线免费播放 | 91精品国产综合久久精品图片 | 在线一二三区 | 久久久久久久免费 | 波多野结衣一区二区三区 | 精品国产乱码久久久久久丨区2区 | 一级欧美黄色片 | 在线免费国产视频 |