21092022-12-20 09:17:09tamasmarkBevásárláscpp17Accepted 100/1003ms4500 KiB
// kodkupa 1 feladat.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

int a, b, c, db, osszeg;

int main()
{
    cin >> a >> b >> c;
    if (a + b + c < 10)
    {
        cout << -1;
    }
    else
    {
        db = 0;
        while (a > 0 && db < 10)
        {
            osszeg = osszeg + 300;
            db++;
            a--;
        }
        while (b > 0 && db < 10)
        {
            osszeg = osszeg + 350;
            db++;
            b--;
        }
        while (c > 0 && db < 10)
        {
            osszeg = osszeg + 400;
            db++;
            c--;
        }
        cout << osszeg;
    }
    return 0;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1876 KiB
2Accepted2ms2124 KiB
3Accepted2ms2648 KiB
subtask210/10
4Accepted2ms2664 KiB
5Accepted2ms2856 KiB
6Accepted2ms2984 KiB
subtask320/20
7Accepted2ms3116 KiB
8Accepted2ms3172 KiB
9Accepted2ms3196 KiB
10Accepted2ms3404 KiB
subtask430/30
11Accepted2ms3600 KiB
12Accepted2ms3812 KiB
13Accepted2ms3916 KiB
14Accepted2ms3948 KiB
subtask540/40
15Accepted2ms3944 KiB
16Accepted2ms4188 KiB
17Accepted2ms4436 KiB
18Accepted2ms4500 KiB
19Accepted2ms4468 KiB
20Accepted2ms4488 KiB