#include <iostream>
using namespace std;

int main() {
    float cnt = 0;
    float time = 0;
    for (int i = 0;i < 5;i++) {
        float s,e;
        cin >> s >> e;
        float a = e-s;
        if (a < 1) {
            a = 0;
        }
        else{
            a -= 1;
        }
        if (a > 4) {
            a = 4;
        }
        time += a;
        //cout << a << " ";
        a = a / 0.5;
        cnt += a * 5000;
    }
    if (time <= 5) {
        cnt = cnt*105 / 100;
    }
    if (time >= 15) {
        cnt = cnt * 95 /100;
    }
    cout << cnt;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: