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 _3Brothers
- {
- class Program
- {
- static void Main(string[] args)
- {
- double A = double.Parse(Console.ReadLine());
- double B = double.Parse(Console.ReadLine());
- double C = double.Parse(Console.ReadLine());
- double D = double.Parse(Console.ReadLine());
- double totalTime = 1 / (1 / A + 1 / B + 1 / C);
- double totalTimeWithRest = totalTime * 0.15 + totalTime;
- double leftTime = D - totalTimeWithRest;
- Console.WriteLine($"Cleaning time: {totalTimeWithRest:F2}");
- if (leftTime > 0)
- {
- Console.WriteLine($"Yes, there is a surprise - time left -> {Math.Floor(leftTime)} hours.");
- }
- else
- {
- leftTime = Math.Abs(leftTime);
- Console.WriteLine($"No, there isn't a surprise - shortage of time -> {Math.Ceiling(leftTime)} hours.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment