Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <cmath>
- using namespace std;
- int mini(int a,int b,int c){
- if (a<=b && a<=c)
- return 1;
- if (b<=a && b<=c)
- return 2;
- return 3;
- }
- int main() {
- int a,b,c,a2,b2,c2;
- cin>>a>>b>>c;
- if (a<1 || b<2 || c<4){
- cout<<0<<endl;
- return 0;
- }
- a2=a;
- b2=ceil(b/2);
- c2=ceil(c/4);
- int min=mini(a2,b2,c2);
- /*cout<<"a1: "<<a2<<endl;
- cout<<"b1: "<<b2<<endl;
- cout<<"c1: "<<c2<<endl;
- cout<<"min: "<<min<<endl;
- */
- if (min==1)
- cout<<(a2+a2*2+a2*4)<<endl;
- else if (min==2)
- cout<<(b2+b2*2+b2*4)<<endl;
- else
- cout<<(c2+c2*2+c2*4)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment