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 ...
随机推荐
- Ajax日记
简要讲Ajax 的内容归纳为博客. AJAX能且仅能从服务器上读取文件,我们使用ajax的时候分为以下几个步骤: 1. 创建ajax对象 2. 链接服务器 3. 发送请求 4. 接收返回值 下 ...
- U盘开发之GPIF Master模式
在U盘开发过程中,一个人从头做到尾,经常遇到一些莫名其妙的问题,只有到官网论坛发帖.折腾困扰我最久的,就是U盘的读写性能问题了,不采用GPIF的方式,single读只有几百K,single写只有几十K ...
- Nand flash 的发展和eMMC
讨论到eMMC的发展历程,必须要从介绍Flash的历史开始 Flash分为两种规格:NOR Flash和NAND Flash,两者均为非易失性闪存模块. 1988年,Intel首次发出NOR flas ...
- NFC-P2P MODE
今日看见有关国内电信业者要合组TSM (Trusted Service Manager)提供NFC 服务的新闻, 这是属于NFC 所能提供的3种Mode中的Card emulation mode (就 ...
- 关于清晰讲解linux正则表达式的博文分享
http://www.cnblogs.com/chengmo/archive/2010/10/10/1847287.html linux shell 正则表达式(BREs,EREs,PREs)差异比 ...
- 将常见对象转换成json字符串
public class JsonUtil { public static String objectTojson(Object obj) { StringBuilder json = new Str ...
- Make 命令教程 -- 阮一峰
摘自http://www.ruanyifeng.com/blog/2015/02/make.html Make 命令教程 作者: 阮一峰 日期: 2015年2月20日 代码变成可执行文件,叫做编译(c ...
- node.async.auto
资料 GITHUB async ASYNC详解—from csdn nodejs的高性能与灵活性让服务端开发变得有了些乐趣,最近在看nodejs在服务端的一些应用,觉得其npm下的众多开源包让其虽没有 ...
- ubuntu设置系统时间与网络时间同步和时区
Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC). 系统时间:指当前Linux Kernel中的时间. 硬件时间:主板上有电池供电的时 ...
- JAVA程序猿面试题汇总
(此话题将不断更新,请留意) 第一,谈谈final, finally, finalize的差别. final 用于声明属性,方法和类,分别表示属性不可变,方法不可覆盖,类不可继承.finally是异常 ...