1 solutions

  • 0
    @ 2025-11-5 18:30:05

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        //freopen("5.in","r",stdin);
        //freopen("5.out","w",stdout);  
        int a,b,c,jsq=0;
        cin>>a>>b>>c;
        for(int x=0;x<=c;x++){
            if((c-a*x)%b==0) {
                //cout<<x<<","<<(c-a*x)/b<<endl;
                if((c-a*x)/b>=0) jsq++;
            }
        }
        cout<<jsq<<endl;
    }
    
    • 1

    Information

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