Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
395 B
1
Indexable
Never
//классная работа
#include <iostream>
#include <cmath>
#include <windows.h>
using namespace std;
int main()
{
    int a, b, c;
    int k;
    cin >> k >> a >> b >> c;
    if (a > (k * 2)){
        a = k * 2;
    }
    if (b > (k * 2)){
        b = k * 2;
    }
    if (c > (k * 2)){
        c = k * 2;
    }
    cout << k * 6 - (a) - (b) - (c);
    return 0;
}
Leave a Comment