1 solutions

  • 0
    @ 2024-12-5 18:19:39

    C++ :

    #include<iostream>
    using namespace std;
    int main(){
        int x,y,z,q;
        cin>>x>>y>>z>>q;
        if(q>=x*2+y*5+z*3){
            cout<<"Yes"<<endl;
            int a=q-x*2-y*5-z*3;
            cout<<a;
        }
        else{
            cout<<"No"<<endl;
            int b=x*2+y*5+z*3-q;
            cout<<b;
        }
        return 0;
    }
    
    • 1

    Information

    ID
    9143
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By