Advertisement
fbinnzhivko

01. Thea the Photographer

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