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