Leyni likes to play with Lolis, but this winter are so cold in harbin! A Group of N Lolis decided to buy b bottles of soft drink to make themselves warmer. Each bottle has D milliliters of the drink. Also They bought l Limes and cut each of the them into k slices. After that they found p grams of salt. To make a toast, each LOLI needs x milliliters of the drink, a slice of lime and y grams of salt. Have the average materials, the lolis want to make toasts as many as they can. How many toasts can each LOLI makes? |
There is multiple test cases. The first line of input was an integer T indicating the number of test cases. Then T test Cases follow. For each test case: Line 1. This line contains eight positive integers, n, b, D, l, K, p, x< /c8>, y (1≤ N, b, D, L, K, p, x, y ≤1000). The numbers is separated by exactly one space. |
In the sample, overall the Lolis has 4 * 5 = milliliters of the drink, it is enough to make 20/3 = 6 toasts. The limes was enough for 8 = toasts and the salt was enough for 100/1 = toasts. However, there is 3 Lolis in the group and so the answer is 6/3 = 2. |
Zidaratu @hrbust#include <cstdio>#include<cmath>#include<queue>#include<iostream>using namespacestd;intMinintXinty) { returnX<y?x:y;}intMain () {intN, B, D, L, K, p, X, y; intT; while(~SCANF ("%d",&T)) { while(t--) {scanf ("%d%d%d%d%d%d%d%d",&n,&b,&d,&l,&k,&p,&x,&y); /*if (n>b) {printf ("0\n"); }*/ //Else// { intNum1=b*d/(nx); intnum2=l*k/N; intnum3=p/(y*N); printf ("%d\n", Min (num1,min (NUM2,NUM3))); // } } } return 0;} |