18332022-12-04 16:15:29peterBevásárláscpp17Accepted 100/1003ms3452 KiB
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a, b, c;
    int costa = 300, costb = 350, costc = 400;
    scanf("%d %d %d", &a, &b, &c);

    if (a + b + c < 10)
    {
        printf("-1");
        return 0;
    }
    int sum;
    if (a > 10)
    {
        sum = 10 * costa;
    }
    else if (a + b >= 10)
    {
        sum = a * costa + (10 - a) * costb;
    }
    else
    {
        sum = a * costa + b * costb + (10 - a - b) * costc;
    }
    printf("%d", sum);



    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1156 KiB
2Accepted2ms1464 KiB
3Accepted2ms1592 KiB
subtask210/10
4Accepted2ms1704 KiB
5Accepted2ms1952 KiB
6Accepted2ms2216 KiB
subtask320/20
7Accepted2ms2192 KiB
8Accepted2ms2400 KiB
9Accepted2ms2336 KiB
10Accepted2ms2388 KiB
subtask430/30
11Accepted2ms2560 KiB
12Accepted2ms2580 KiB
13Accepted2ms2640 KiB
14Accepted2ms2960 KiB
subtask540/40
15Accepted2ms3160 KiB
16Accepted2ms3172 KiB
17Accepted2ms3220 KiB
18Accepted2ms3240 KiB
19Accepted2ms3452 KiB
20Accepted2ms3432 KiB