题目

{% raw %}

点击显/隐题目
{% endraw %} 作为调酒师的西瓜,在生日当天,请了N位好朋友来家中作客,当然免不了大展身手。西瓜在超市买了A瓶酒,每瓶酒有B毫升,买了C个柠檬,把每一个柠檬切成D片,还买了E克盐。西瓜要调的酒,每一杯需要F毫升的原味酒、一片柠檬以及G克盐。

西瓜希望每个朋友分到同样杯数的酒,同时西瓜又希望每个人分到的酒尽可能多。问每个朋友能分到几杯调好的酒。

{% raw %}



{% endraw %}

一个整数t,表示测试数据组数(1<=t<=100)
对于每一组数据,共一行,有8个整数,逗号隔开,分别为N,A,B,C,D,E,F,G,其中这7个整数都在[0, 1000]内,保证N不为0。

{% raw %}



{% endraw %}

每一组测试数据,输出一个整数,表示每个朋友分到的酒的杯数。

{% raw %}





{% endraw %}

2
2 4 7 3 4 10 2 1
1 1000 1000 1000 1000 1000 1 1

{% raw %}



{% endraw %}

5
1000

{% raw %}




{% endraw %}

题解

首先根据每个原料的要求求出来最少能做出来多少杯酒
然后用杯数除以人数得到答案

代码

点击显/隐代码
```cpp 调酒师 https://github.com/OhYee/sourcecode/tree/master/ACM 代码备份 /*/ #define debug #include //*/ #include #include #include using namespace std;

int a[8];
int main(){
#ifdef debug
freopen("in.txt", "r", stdin);
int START = clock();
#endif
cin.tie(0);
cin.sync_with_stdio(false);

int T;
cin >> T;
while(T--){
    for(int i=0;i<8;i++)
        cin >> a[i];
    int ans = min(min(a[1]*a[2]/a[6],a[3]*a[4]),a[5]/a[7]);
    //cout << a[1]*a[2]/a[6] << " " << a[3]*a[4] << " " << a[5]/a[7] << endl;

    cout << ans/a[0] << endl;
}

#ifdef debug
printf("Time:%.3fs.\n", double(clock() - START) / CLOCKS_PER_SEC);
#endif
return 0;

}

</div>