Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Numerics;
- using System.Threading;
- using System.Transactions;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- List<string> fire = Console.ReadLine().Split('#').ToList();
- double water = double.Parse(Console.ReadLine());
- List<int> finalFire = new List<int>();
- for (int i = 0; i < fire.Count; i++)
- {
- string[] command = fire[i].Split(" = ").ToArray();
- if (command[0] == "High")
- {
- int index = int.Parse(command[1]);
- if (index >= 81 && index <= 125)
- {
- if (water >= index)
- {
- finalFire.Add(index);
- water -= index;
- }
- }
- }
- if (command[0] == "Medium")
- {
- int index = int.Parse(command[1]);
- if (index >= 51 && index <= 80)
- {
- if (water >= index)
- {
- finalFire.Add(index);
- water -= index;
- }
- }
- }
- if (command[0] == "Low")
- {
- int index = int.Parse(command[1]);
- if (index >= 1 && index <= 50)
- {
- if (water >= index)
- {
- finalFire.Add(index);
- water -= index;
- }
- }
- }
- }
- Console.WriteLine("Cells:");
- for (int i = 0; i < finalFire.Count; i++)
- {
- Console.WriteLine($" - {finalFire[i]}");
- }
- Console.WriteLine($"Effort: {finalFire.Sum() * 0.25:f2}");
- Console.WriteLine($"Total Fire: {finalFire.Sum()}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement