Codeforces 151A Soft drink Solution

Solve in C++:


#include<bits/stdc++.h>
using namespace std;
int main()
{

    int n, k, l, c, d, p, nl, np,t1,t2,kl,cd,r1,r2,t;
    while(scanf("%d%d%d%d%d%d%d%d",&n, &k, &l, &c, &d, &p,&nl,&np)!=EOF)

    {
        kl=k*l;
        t1=kl/nl;
        cd=c*d;
        t2=p/np;
        r1=min(t1,cd);
        r2=min(r1,t2);

        printf("%d\n",r2/n);
    }

    return 0;
}

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.