多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

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

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

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

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; } }



生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 欧美一欧美一级毛片 | 久久精品国产99久久99久久久 | 久久国产高清一区二区三区 | 性色aⅴ闺蜜一区二区三区 性色aⅴ在线观看swag | 羞羞影院免费观看网址在线 | 欧美一区二区三区不卡 | 精品国产午夜肉伦伦影院 | 中文精品久久久久国产不卡 | 欧美三级视频在线观看 | 伊人网欧美 | 日韩福利在线视频 | 日本一区二区视频在线观看 | 欧美综合伊人久久 | 午夜视频在线观看视频 | 成人hd | 日本不卡网| 黄色小说校园春色 | 91亚洲国产成人精品性色 | 亚洲二区在线观看 | 免费观看视频网站 | 波多野结衣中文字幕在线视频 | 欧美性受xxxx黑人xyx性爽 | 久久精品免观看国产成人 | 欧美专区在线视频 | 亚洲欧美日韩一区二区 | 亚洲老女人 | 福利在线网站 | 国产不卡在线视频 | 亚洲精品日韩中文字幕久久久 | 国产做人爱三级视频在线 | 亚洲乱码一二三四五六区 | 伊人a.v在线| 日韩天天摸天天澡天天爽视频 | xart欧美在线播放精品4k | 最近中文字幕++中文 | 亚洲网站在线 | 中文乱码字幕午夜无线观看 | 日韩一区二区三区四区不卡 | 国产精品成人久久久久久久 | 武则天全黄肉体毛片免费看 | h在线观看网站 |