Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ONLINE_JUDGE
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- namespace Basic_Syntax
- {
- class DCP4Great____The_Work_Is_Done
- {
- public static void Main()
- {
- string line;
- while ((line = Console.ReadLine()) != null)
- {
- var first = line.Split(' ');
- var totalHour = Convert.ToInt32(first[0]);
- var totalEmployee = Convert.ToInt32(first[1]);
- double[] workHour = new double[totalEmployee];
- for (int i = 0; i < totalEmployee; i++)
- {
- workHour[i] = Convert.ToInt32(Console.ReadLine());
- }
- var totalWorkhourInaSingleDay = 0.0;
- for (int i = 0; i < totalEmployee; i++)
- {
- totalWorkhourInaSingleDay += workHour[i];
- }
- double result = (double)(totalHour / totalWorkhourInaSingleDay);
- if (result <= 1)
- {
- Console.WriteLine("Project will finish within 1 day.");
- }
- else
- {
- double resultDecimal = result - Math.Floor(result);
- if (resultDecimal > 0)
- {
- Console.WriteLine($"Project will finish within {(int)result + 1} days.");
- }
- else
- {
- Console.WriteLine($"Project will finish within {(int)result} days.");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement