Advertisement
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 energyLoss
- {
- class Program
- {
- static void Main(string[] args)
- {
- double trainingDays = double.Parse(Console.ReadLine());
- double numberOfDancers = double.Parse(Console.ReadLine());
- double allEnergyOfDancers = 100 * trainingDays * numberOfDancers;
- double lossEnergy = 0;
- for (int i = 1; i <= trainingDays; i++)
- {
- double trainingHours = double.Parse(Console.ReadLine());
- if (i%2==0 && trainingHours%2==0 )
- {
- lossEnergy += 10 * 68;
- }
- else if (i%2!=0 && trainingHours%2!=0)
- {
- lossEnergy += 10 * 30;
- }
- else if (i%2==0 && trainingHours%2!=0)
- {
- lossEnergy += 10 * 65;
- }
- else if (i%2!=0 && trainingHours%2==0)
- {
- lossEnergy += 10 * 49;
- }
- }
- double remainEnergy = allEnergyOfDancers - lossEnergy;
- double remainEnergyForDayPerDancer = remainEnergy / numberOfDancers / trainingDays;
- if (lossEnergy <= allEnergyOfDancers/2)
- {
- Console.WriteLine($"They feel good! Energy left: {remainEnergyForDayPerDancer:f2}");
- }
- else
- {
- Console.WriteLine($"They are wasted! Energy left: {remainEnergyForDayPerDancer:f2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement