petarkobakov

National Court

Jun 30th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace National_Court
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. byte efficiensy1 = byte.Parse(Console.ReadLine());
  10. byte efficiensy2 = byte.Parse(Console.ReadLine());
  11. byte efficiensy3 = byte.Parse(Console.ReadLine());
  12. int peopleCount = int.Parse(Console.ReadLine());
  13.  
  14. int totalEfficiensy = (int)(efficiensy1+efficiensy2+efficiensy3);
  15. int hours = 0;
  16.  
  17. while (peopleCount>0)
  18. {
  19. peopleCount -= totalEfficiensy;
  20. hours++;
  21. if ((hours%4)==0)
  22. {
  23. hours++;
  24. }
  25.  
  26. }
  27.  
  28. Console.WriteLine($"Time needed: {hours}h.");
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment