2 solutions

  • 2
    @ 2026-2-26 15:24:19
    #include<bits/stdc++.h>
    using namespace std;
    int n,k,x,y;
    int main(){
    	cin>>n>>k>>x>>y;
    	if(n<=k) cout<<n*x;
    	else cout<<k*x+(n-k)*y;
    	return 0;
    }
    

    \(^o^)/

    Information

    ID
    4958
    Time
    2000ms
    Memory
    256MiB
    Difficulty
    2
    Tags
    (None)
    # Submissions
    35
    Accepted
    24
    Uploaded By