3 solutions

  • 2
    @ 2026-1-23 12:11:03

    #include <bits/stdc++.h>

    using namespace std;

    int main() {

    int a;

    cin >> a;

    if (a <= 10) {

    cout << fixed << setprecision(2) << a * 0.8+
    0.2;
    } 
    

    else if (a > 10 && a <= 20) {

    cout << fixed << setprecision(2) << (a-10) 
    * 0.75 +10*0.8+0.2;
    } 
    

    else if (a > 20 && a <= 30) {

    cout << fixed << setprecision(2) << (a-20)*
    0.7+10*0.75+10*0.8+0.2;
    } 
    

    else {

    cout << "Fail";
    }
    
    return 0;
    

    }

    Information

    ID
    144
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    7
    Tags
    # Submissions
    305
    Accepted
    63
    Uploaded By