3 solutions

  • 1
    @ 2026-2-23 12:08:38
    #include<bits/stdc++.h>
    using namespace std;
    int main() {
        int x, y, n, p;
        cin >> x >> y >> n >> p;
    double a, b; 
        if (p >= x) {
            a = p - y;
        } else {
            a = p; 
        }
        b = p * n / 10.0; 
        cout << fixed << setprecision(2) << min(a, b);
    return 0;
    }
    
    

    Information

    ID
    25
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    7
    Tags
    # Submissions
    41
    Accepted
    10
    Uploaded By