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