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 n = int.Parse(Console.ReadLine()); //период време
- int threadpatients = 0;
- int unthreadpatients = 0;
- int doctors = 7;
- for (int i = 1; i <= n; i++)
- {
- var patients = int.Parse(Console.ReadLine());
- if ((i%3==0)&&(unthreadpatients>threadpatients))
- {
- doctors++;
- }
- if (patients>doctors)
- {
- threadpatients += doctors;
- unthreadpatients += patients - doctors;
- }
- else
- {
- threadpatients+=patients ;
- }
- }
- Console.WriteLine("Treated patients: {0}.", threadpatients);
- Console.WriteLine("Untreated patients: {0}.", unthreadpatients);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment