Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: cyblox_boi

Problemset: Slowly Express

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-22 23:19:59

#include <iostream>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int left = 0;

	while (true) {
		int n;
		cin >> n;

		if (n < 0) {
			break;
		}

		int cars = 0;
		left += n;

		while (left >= 500) {
			cars++;

			if (left >= 800) {
				left -= 800;
			} else if (left >= 500) {
				left = 0;
			}
		}

		cout << cars << '\n';
	}

	return 0;
}