Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Hospital
- {
- class Program
- {
- static void Main(string[] args)
- {
- int period = int.Parse(Console.ReadLine());
- int treated = 0;
- int untreated = 0;
- int doctors = 7;
- for (int i = 1; i <= period; i++)
- {
- int patients = int.Parse(Console.ReadLine());
- if (untreated > treated && i % 3 == 0)
- {
- doctors++;
- }
- if (patients > doctors)
- {
- treated += doctors;
- untreated += patients - doctors;
- }
- else
- {
- treated += patients;
- }
- }
- Console.WriteLine($"Treated patients: { treated}.");
- Console.WriteLine($"Untreated patients: { untreated}.");
- }
- }
- }
Add Comment
Please, Sign In to add comment