Untitled

 avatar
unknown
plain_text
2 years ago
441 B
3
Indexable
#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;
}
Editor is loading...
Leave a Comment