Advertisement
Mim1111

Untitled

Feb 16th, 2022
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. using System;
  2.  
  3. namespace МЕ01._SoftUni_Reception
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int numOfStudentPer1hour1 = int.Parse(Console.ReadLine());
  10. int numOfStudentPer1hour2 = int.Parse(Console.ReadLine());
  11. int numOfStudentPer1hour3 = int.Parse(Console.ReadLine());
  12. int studenCount = int.Parse(Console.ReadLine());
  13.  
  14. int houerCount = 0;
  15. int maxStudenForHouer = numOfStudentPer1hour1 + numOfStudentPer1hour2 + numOfStudentPer1hour3;
  16.  
  17.  
  18. if (studenCount%maxStudenForHouer==0)
  19. {
  20. houerCount = studenCount / maxStudenForHouer;
  21. }
  22. else if (studenCount % maxStudenForHouer != 0)
  23. {
  24. houerCount = studenCount / maxStudenForHouer + 1;
  25. }
  26.  
  27. if (houerCount>3)
  28. {
  29. houerCount += houerCount / 3;
  30. }
  31.  
  32. Console.WriteLine($"Time needed: {houerCount}h.");
  33. }
  34. }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement