1 solutions

  • 0
    @ 2025-8-7 11:51:55
    #include <bits/stdc++.h>
    using namespace std;
    const int N = 1e5 + 5;
    int n,k,x,y,ans;
    
    signed main() {
    	cin>>n>>k>>x>>y;
    	if(n<=k){
    		ans=n*x;
    	}else{
    		n-=k;
    		ans=k*x+n*y;
    	}
    	cout<<ans<<"\n";
    	return 0;
    }//4 9 10
    

    Information

    ID
    4958
    Time
    2000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    (None)
    # Submissions
    5
    Accepted
    5
    Uploaded By