Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
441 B
1
Indexable
Never
#include <iostream>
using namespace std;

int main() {
	setlocale(LC_ALL, "Russian");
	int N, M, L, K;
	cin >> N >> M >> L >> K;

	int white = 2 * K - N;
	int blue = 2 * K - M;
	int red = 2 * K - L;

	if (white < 0) white = 0;
	if (blue < 0) blue = 0;
	if (red < 0) red = 0;

	int total = white + blue + red;

	cout << "Вам нужно докупить " << total << " листов бумаги" << endl;

	return 0;
}
Leave a Comment