113762024-08-29 12:14:43MCDaveBevásárláscpp17Accepted 100/1003ms632 KiB
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n = 10, a, b, c, out = 0;
	cin >> a >> b >> c;
	out += min(a, n) * 300, n -= min(a, n);
	out += min(b, n) * 350,	n -= min(b, n);
	out += min(c, n) * 400, n -= min(c, n);

	if (n != 0)
	{
		cout << -1;
		return 0;
	}

	cout << out;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms488 KiB
2Accepted3ms420 KiB
3Accepted3ms232 KiB
subtask210/10
4Accepted2ms488 KiB
5Accepted3ms488 KiB
6Accepted3ms488 KiB
subtask320/20
7Accepted3ms540 KiB
8Accepted2ms360 KiB
9Accepted3ms512 KiB
10Accepted2ms376 KiB
subtask430/30
11Accepted2ms632 KiB
12Accepted3ms504 KiB
13Accepted2ms492 KiB
14Accepted3ms424 KiB
subtask540/40
15Accepted3ms256 KiB
16Accepted3ms388 KiB
17Accepted3ms256 KiB
18Accepted3ms488 KiB
19Accepted2ms360 KiB
20Accepted2ms384 KiB