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

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.