Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SoftUniReception
- {
- class Program
- {
- static void Main(string[] args)
- {
- int first = int.Parse(Console.ReadLine());
- int second = int.Parse(Console.ReadLine());
- int third = int.Parse(Console.ReadLine());
- int students = int.Parse(Console.ReadLine());
- int counter = 1, hours = 0;
- while (students > 0)
- {
- students -= first + second + third;
- hours += counter % 3 == 0 && students > 0 ? 2 : 1;
- counter += 1;
- }
- Console.WriteLine($"Time needed: {hours}h.\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement