Advertisement
fbinnzhivko

Thea the Photographer

Sep 13th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         long picturesCount = int.Parse(Console.ReadLine());
  7.         long filterTime = int.Parse(Console.ReadLine());
  8.         long filterFactor = int.Parse(Console.ReadLine());
  9.         long uploadTime = int.Parse(Console.ReadLine());
  10.  
  11.         var usefulPictures = Math.Ceiling(picturesCount * (filterFactor / 100.0));
  12.         long totalPictures = picturesCount * filterTime;
  13.         long uploadedPictures = usefulPictures * uploadTime;
  14.         long total = totalPictures + uploadedPictures;
  15.        
  16.         long secounds, minutes, hours, days;
  17.  
  18.         secounds = total % 60;
  19.         total = total - secounds;
  20.         hours = total / 3600;
  21.         minutes = total / 60 - hours * 60;
  22.         days = hours / 24;
  23.         hours = total / 3600 - days * 24;
  24.  
  25.         Console.WriteLine("{0}:{1}:{2}:{3}", days, hours.ToString("00"), minutes.ToString("00"), secounds.ToString("00"));
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement