Soft Drinking(水)
2 seconds
256 megabytes
standard input
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?
The first and only line contains positive integers n, k, l, c, d, p, nl, np, not exceeding 1000 and no less than 1. The numbers are separated by exactly one space.
Print a single integer — the number of toasts each friend can make.
3 4 5 10 8 100 3 1
2
5 100 10 1 19 90 4 3
3
10 1000 1000 25 23 1 50 1
0
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 = 80 toasts 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.
题解:水题:配饮料的,问每个人能配几瓶;
代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int INF=0x3f3f3f3f;
#define SI(x) scanf("%d",&x)
#define PI(x) printf("%d",x)
#define P_ printf(" ") int main(){
int n,k,l,c,d,p,nl,np;
while(~scanf("%d%d%d%d%d%d%d%d",&n,&k,&l,&c,&d,&p,&nl,&np)){
printf("%d\n",min(min(k*l/nl,c*d),p/np)/n);
}
return ;
}
Soft Drinking(水)的更多相关文章
- Codeforces Round #107 (Div. 2)---A. Soft Drinking
Soft Drinking time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...
- Hardwood Species(水)
Time Limit:10000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatus Descrip ...
- 从零开始Unity3D游戏开发【2 简单的水管工例子】
1.首先,创建一个新的Project. 2.hierarchy(层)窗体下的Create下添加一个plane(平面) 3.调整Main Camera的视角,让panel显示在Game窗体.这一步比较困 ...
- Taking water into exams could boost grades 考试带瓶水可以提高成绩?
Takeing a bottle of water into the exam hall could help students boost their grades, researchers cla ...
- Hihocoder #1095 : HIHO Drinking Game (微软苏州校招笔试)( *【二分搜索最优解】)
#1095 : HIHO Drinking Game 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi and Little Ho are playin ...
- codeforces 667A A. Pouring Rain(水题)
题目链接: A. Pouring Rain time limit per test 1 second memory limit per test 256 megabytes input standar ...
- ubuntu20.04并添加桌面快捷方式,以安装火狐可浏览器开发版(水狐)为例
@参考原文 1. 下载linux版源文件 从火狐官网下载linux版的水狐源文件压缩包,@火狐浏览器开发版(水狐)下载地址. 2. 解压下载源文件 将下载的"tar.bz2"文件解 ...
- 数据库设计中的Soft Delete模式
最近几天有点忙,所以我们今天来一篇短的,简单地介绍一下数据库设计中的一种模式——Soft Delete. 可以说,该模式毁誉参半,甚至有非常多的人认为该模式是一个Anti-Pattern.因此在本篇文 ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
随机推荐
- activity 的返回按钮
http://www.2cto.com/kf/201210/160251.html 连续点击两次程序就退出程序,这是一个很有趣的程序功能,下来介绍一下我的实现方式(欢迎大家拍砖指点): 1.在Ac ...
- delphi 获取北京时间(使用XMLHTTP获取百度的时间,WebBrowser获取www.timedate.cn的时间)
方法一: uses ComObj, DateUtils; function GetInternetTime: string; var XmlHttp: OleVariant; datetxt: str ...
- ARM和X86功耗差别的深层原因探讨
ARM和X86功耗差别的深层原因探讨 ARM和X86功耗的差别一直是个很热的话题.ARM可以做的很低,甚至1瓦都不到.而X86服务器的芯片可以达到100-200瓦,就算是嵌入式处理器Atom系列也需要 ...
- cf459A Pashmak and Garden
A. Pashmak and Garden time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Android的数据存储方式(转)
数据存储在开发中是使用最频繁的,在这里主要介绍Android平台中实现数据存储的5种方式,分别是: 1 使用SharedPreferences存储数据 2 文件存储数据 3 SQLite数据库存储数据 ...
- Linux 下如何安装软件?
http://zhidao.baidu.com/link?url=OkQCOZtVMXhasC8x9zFTZOumsFKf0WW25Ckr2wBF1xO08EsjrBpnMaTBlIAUYdxZ408 ...
- linux shell自定义函数(定义、返回值、变量作用域)介绍
http://www.jb51.net/article/33899.htm linux shell自定义函数(定义.返回值.变量作用域)介绍 linux shell 可以用户定义函数,然后在shell ...
- iOS GCD详解
前言 对初学者来说,GCD似乎是一道迈不过去的坎,很多人在同步.异步.串行.并行和死锁这几个名词的漩涡中渐渐放弃治疗.本文将使用图文表并茂的方式给大家形象地解释其中的原理和规律. 线程.任务和队列的概 ...
- hdu4135Co-prime 容斥原理水题
//问一个区间[a,b]与n互素的数的个数 //利用容斥原理可知 //在[a,b] 区间内对n的素数因子 //ans = 被一个数整除的数的个数 - 被两个数的最小公倍数整除的数的个数 + 被三个数的 ...
- SpringMVC+easyui显示数据
近期做毕业设计,想用easyui,先学习一下CRUD.今天先弄了个表格显示数据库的数据.jsp页面还有非常多其他元素,我就不贴上去了.我显示数据的JSP为/WebContent/WEB-INF/vie ...