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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

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

Powered by Blogger.