Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EAXAM_The_Hunting_Games
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int players = int.Parse(Console.ReadLine());
- double energy = double.Parse(Console.ReadLine());
- double water = double.Parse(Console.ReadLine());
- double food = double.Parse(Console.ReadLine());
- double energyLoss = double.Parse(Console.ReadLine());
- double currEnergy = 0;
- double currWater = 0;
- double currFood = 0;
- double totalWater = days * players * water;
- double totalFood = days * players * food;
- if (energy <= 0) return;
- for (int currDay = 1; currDay <= days; currDay++)
- {
- currEnergy = energy - energyLoss;
- if (currDay % 2 == 0)
- {
- currEnergy = totalWater - currEnergy * 0.05;
- currWater -= currWater * 0.30;
- }
- if (currDay % 3 == 0)
- {
- currFood -= currFood / players;
- currEnergy += currEnergy * 0.10;
- }
- }
- if (currEnergy > energy)
- {
- Console.WriteLine($"You are ready for the quest. You will be left with - {currEnergy} energy!");
- }
- else
- {
- Console.WriteLine($"You will run out of energy. You will be left with {currFood:F2} food and {currWater:F2} water.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment