sgu184:Patties
2014-11-22 14:07
302 查看
184. Patties
time limit per test: 0.25 sec.memory limit per test: 4096 KB
input: standard input
output: standard output
Petya is well-known with his famous cabbage patties. Petya's birthday will come very soon, and he wants to invite as many guests as possible. But the boy wants everybody to try his specialty of the house. That's why he needs to know the number of the patties
he can cook using the stocked ingredients. Petya has P grams of flour, M milliliters of milk and C grams of cabbage. He has plenty of other ingredients. Petya knows that he needs K grams of flour, R milliliters of milk and V grams of cabbage to cook one patty.
Please, help Petya calculate the maximum number of patties he can cook.
Input
The input file contains integer numbers P, M, C, K, R and V, separated by spaces and/or line breaks (1 <= P, M, C, K, R, V <= 10000).
Output
Output the maximum number of patties Petya can cook.
Sample test(s)
Input
3000 1000 500 30 15 60
Output
8
[submit]
[forum]
Author: | Andrew V. Lazarev |
Resource: | ACM International Collegiate Programming Contest 2003-2004 North-Eastern European Region, Southern Subregion |
Date: | 2003 October, 9 |
#include <cstdio> #include <algorithm> using namespace std; int main() { int a, b, c, d, e, f, ans; scanf("%d%d%d", &a, &b, &c); scanf("%d%d%d", &d, &e, &f); ans = a/d; ans = min(ans, b/e); ans = min(ans, c/f); printf("%d", ans); return 0; }
|
相关文章推荐
- SGU - 184 - Patties
- SGU184——Patties
- sgu 184 Patties
- sgu-184 Patties 果然是一道好(shui)题
- sgu 135 + 184 +117+126+114+118+127
- 我自己写的一点sgu题解
- [SGU 108]Self-numbers II(筛法活用优化+滚动数组)
- 【sgu】106 解题报告
- 卡特兰数——sgu130Circle
- SGU 109 Magic of David Copperfield II 翻译 题解
- sgu 154 二分 + 数学方法 sgu 111 二分 + 高精度 (Java)
- SGU 104 Little shop of flowers
- SGU 116 Index of super-prime
- sgu 208 Toral Tickets polya定理
- [SGU220 Little Bishops]
- Sgu105
- SGU 223 Little Kings
- SGU_106 The equation 同余方程
- sgu 242 Student's Morning--最大流 或 多重匹配
- sgu——340(字符串模拟)