Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Numerics;
- using System.Text;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Reflection.Metadata.Ecma335;
- using System.Runtime.ExceptionServices;
- using System.Threading;
- using System.Text.RegularExpressions;
- namespace ConsoleApp24
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int playerCount = int.Parse(Console.ReadLine());
- double HP = double.Parse(Console.ReadLine());
- double waterPerPerson = double.Parse(Console.ReadLine());
- double foodPerPerson = double.Parse(Console.ReadLine());
- double totalWater = waterPerPerson * playerCount*days;
- double totalFood = foodPerPerson * playerCount*days;
- for (int i = 1; i <= days; i++)
- {
- double HPloss = double.Parse(Console.ReadLine());
- HP -= HPloss;
- if (HP <= 0)
- {
- break;
- }
- if (i % 2 == 0 && i >= 2)
- {
- HP *= 1.05;
- totalWater *= 0.7;
- }
- if (i % 3 == 0 && i >= 3)
- {
- totalFood -= ((double)totalFood / playerCount);
- HP *= 1.1;
- }
- }
- if (HP > 0)
- {
- Console.WriteLine($"You are ready for the quest. You will be left with - {HP:f2} energy!");
- }
- else
- {
- Console.WriteLine($"You will run out of energy. You will be left with {totalFood:f2} food and {totalWater:f2} water.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment