<file_sep>﻿using System;

namespace Moving
{
    class Program
    {
        static void Main(string[] args)
        {
            int freeWidth = int.Parse(Console.ReadLine());
            int freeLength = int.Parse(Console.ReadLine());
            int freeHeight = int.Parse(Console.ReadLine());

            int size = freeHeight * freeLength * freeWidth;
            int sum = 0;
            bool overSize = false;

            string command = Console.ReadLine();
            while(command != "Done")
            {
                int neededSpace = int.Parse(command);
                sum += neededSpace;
                if(sum > size)
                {
                    overSize = true;
                    break;
                }
                command = Console.ReadLine();
            }
            if (overSize)
            {
                Console.WriteLine($"No more free space! You need {sum - size} Cubic meters more.");
            }
            else
            {
                Console.WriteLine($"{size - sum } Cubic meters left.");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._Common_Elements
{
    class Program
    {
        static void Main(string[] args)
        {
           // string input = Console.ReadLine();
           ////1
            //Console.WriteLine(string.Join(" ", arr1));
            /*foreach (var item in arr1)
            {
                Console.Write(item);
            }
            //Console.WriteLine(arr1[2]);
            */
            string[] arr1 = Console.ReadLine().Split();
            string[] arr2 = Console.ReadLine().Split();

            for (int i = 0; i < arr2.Length; i++)
            {
                for (int j = 0; j < arr1.Length; j++)
                {
                    if(arr2[i] == arr1[j])
                    {
                        Console.Write($"{arr2[i]} ");
                    }
                }
            }


        }
    }
}
<file_sep>﻿using System;

namespace _01._SoftUni_Reception
{
    class Program
    {
        static void Main(string[] args)
        {
            int studentsPerHour1 = int.Parse(Console.ReadLine());
            int studentsPerHour2 = int.Parse(Console.ReadLine());
            int studentsPerHour3 = int.Parse(Console.ReadLine());
            int studentsCount = int.Parse(Console.ReadLine());

            int allStudentsPerHour = studentsPerHour1 + studentsPerHour2 + studentsPerHour3;
            int timeNeeded = 0;

            while(studentsCount > 0)
            {
                timeNeeded += 1;
                if (timeNeeded % 4 == 0)
                {
                    timeNeeded += 1;
                }
                if (allStudentsPerHour >= studentsCount)
                {
                    break;
                }
                else
                {
                    studentsCount -= allStudentsPerHour;
                }
            }

            Console.WriteLine($"Time needed: {timeNeeded}h.");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace P01.BasicStackOperations
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] cmdArgs = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            int N = cmdArgs[0];
            int S = cmdArgs[1];
            int X = cmdArgs[2];


            int[] numbers = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            Stack<int> stack = new Stack<int>(numbers);

            //for(int i = 0; i < N; i++)
            //{
            //    stack.Push(numbers[i]);
            //}
            for (int i = 0; i < S; i++)
            {
                stack.Pop();
            }


            if (!stack.Any())
            {
                Console.WriteLine(0);
            }
            else if(stack.Any(n => n == X))
            {
                Console.WriteLine("true");
            }
            else
            {
                Console.WriteLine(stack.Min());
            }
               
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._Inbox_Manager
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, List<string>> users = new Dictionary<string, List<string>>();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "Statistics")
                {
                    break;
                }
                string[] command = input
                    .Split("->");

                string user = command[1];
                switch (command[0])
                {
                    
                    case "Add":
                        
                        if (!users.ContainsKey(user))
                        {
                            users[user] = new List<string>();
                        }
                        else
                        {
                            Console.WriteLine($"{user} is already registered");
                        }
                        break;
                    case "Send":
                        string email = command[2];
                        if (users.ContainsKey(user))
                        {
                            users[user].Add(email);
                        }
                        break;
                    case "Delete":
                        if (users.ContainsKey(user))
                        {
                            users.Remove(user);
                        }
                        else
                        {
                            Console.WriteLine($"{user} not found!");
                        }
                        break;                      
                }
            
            }
            users = users
                .OrderByDescending(kvp => kvp.Value.Count)
                .ThenBy(kvp => kvp.Key)
                .ToDictionary(a => a.Key, b => b.Value);


            Console.WriteLine($"Users count: {users.Count}");
            foreach (var kvp in users)
            {
                Console.WriteLine(kvp.Key);
                foreach (string email in kvp.Value)
                {
                    Console.WriteLine($"- {email}");
                }
            }

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _07._Predicate_For_Names
{
    class Program
    {
        static void Main(string[] args)
        {
            int length = int.Parse(Console.ReadLine());
            string[] names = Console.ReadLine()
                .Split();

            Predicate<string> filterForNames = new Predicate<string>((name)
                => name.Length <= length);

            Action<string[]> FiltersNames = new Action<string[]>((names) =>
             {
                 foreach (string name in names)
                 {
                     if (filterForNames(name))
                     {
                         Console.WriteLine(name);
                     }
                 }
                //return names;
 
             });
            FiltersNames(names);

        }
    }
}
<file_sep>﻿using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace _03._SoftUni_Bar_Income
{
    class Program
    {
        static void Main(string[] args)
        {
            double income = 0;
            //string pattern = @"%(?<name>[A-z][a-z]+)%[^|$%.]*<(?<productName>[\w]+)>[^|$%.]*\|(?<quantity>\d+)\|[^|$%.]*(?<price>\d+(\.\d+)?)\$";
            // string pattern = @"^%(?<name>[A-Z][a-z]+)%[^|$%.]*<(?<productName>\w+)>[^|$%.]*\|(?<quantity>\d+)\|[^|$%.]*?(?<price>[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\$";
            string pattern = @"%(?<name>[A-z][a-z]+)%[^|$%.]*<(?<productName>\w+)>[^|$%.]*\|(?<quantity>\d+)\|[^|$%.]*?(?<price>\d+\.?\d*)\$";
            //string pattern = @"^%(?<customer>[A-Z][a-z]+)%[^|$%.]*<(?<product>\w+)>[^|$%.]*\|(?<count>\d+)\|[^|$%.]*?(?<price>[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\$";
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end of shift")
                {
                    break;
                }

                if (Regex.IsMatch(input, pattern))
                {
                    var match = Regex.Match(input, pattern);
                    string name = match.Groups["name"].Value;
                    string product = match.Groups["productName"].Value;
                    double totalPrice = int.Parse(match.Groups["quantity"].Value)
                        * double.Parse(match.Groups["price"].Value);

                    Console.WriteLine($"{name}: {product} - {totalPrice:F2}");

                    income += totalPrice; 

                }
                
            }

            Console.WriteLine($"Total income: {income:F2}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace Polymorphism
{
    class Program
    {
        static void Main(string[] args)
        {
            //Vehicle vehicle = new Airplane();


            Vehicle airplane = new Airplane();
            Vehicle truck = new Truck();

            //PrintVehicleModel(airplane);
            //PrintVehicleModel(truck);

            var vehicles = new List<IVehicle> { airplane, truck, new Ship()};

            PrintVrumVrum(airplane);
            PrintVrumVrum(truck);
            PrintVrumVrum(new AirFighter());
            PrintVrumVrum(new CatOnJet());

            var anotherAirplane = new Airplane();

            Console.WriteLine(anotherAirplane.VrumVrum(10));
            
             
        }
        public static void PrintVrumVrum(Vehicle vehicle)
        {
            //if(vehicle is Airplane airplane)////Bad way of doing
            //{
            //    Console.WriteLine(airplane.VrumVrum());
            //}
            //else if(vehicle is CatOnJet catOnJet)
            //{
            //    Console.WriteLine(catOnJet.VrumVrum());
            //}
            Console.WriteLine(vehicle.VrumVrum());


        }

        public static void PrintVehicleModel(Vehicle vehicle)
        {
            Console.WriteLine(vehicle.Model);
        }
    }
}
<file_sep>﻿using System;

namespace LeftAndRightSum
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int leftsum = 0;
            int rightsum = 0;
            for(int i=0;i<n*2;i++)
            {
                int num = int.Parse(Console.ReadLine());
                if(i<n)
                {
                    leftsum += num;
                }
                else if(i<n*2)
                {
                    rightsum += num;
                }
            }
            
            if(rightsum == leftsum)
            {
                Console.WriteLine($"Yes, sum = {rightsum}");
            }
            else
            {
                Console.WriteLine($"No, diff = {Math.Abs(rightsum-leftsum)}");

            }

        }
    }
}
<file_sep>﻿using P04.PizzaCalories.Ingredients;
using System;

namespace P04.PizzaCalories
{
    public class StartUp
    {
        static void Main(string[] args)
        {
            try
            {
                string[] inputName = Console.ReadLine().Split();
                string pizzaName = inputName[1];

                string[] inputDough = Console.ReadLine().Split();
                string flourType = inputDough[1];
                string bakingTech = inputDough[2];
                double weight = double.Parse(inputDough[3]);

                Dough dough = new Dough(flourType, bakingTech, weight);

                ////Creating pizza

                Pizza pizza = new Pizza(pizzaName, dough);

                string command;
                while((command=Console.ReadLine()) != "END")
                {
                    string[] commandArgs = command
                    .Split();
      
                     string toppingType = commandArgs[1];
                     double weight1 = double.Parse(commandArgs[2]);

                     Topping topping = new Topping(toppingType, weight1);

                    pizza.AddTopping(topping);

                      //  Console.WriteLine($"{topping.ToppingCalories():F2}");
                }
                Console.WriteLine($"{pizza.Name} - {pizza.TotalCalories:F2} Calories.");
            }
            catch (Exception e)
            {

                Console.WriteLine(e.Message);
            }
            
        }
    }
}
<file_sep>﻿using System;

namespace Vacation
{
    class Program
    {
        static void Main(string[] args)
        {
            int peopleCount = int.Parse(Console.ReadLine());
            string typeGroup = Console.ReadLine();
            string day = Console.ReadLine();
            double price = 0;

            if(typeGroup == "Students")
            {
                switch (day)
                {
                    case "Friday":
                        price = peopleCount * 8.45;
                        break;
                    case "Saturday":
                        price = peopleCount * 9.80;
                        break;
                    case "Sunday":
                        price = peopleCount * 10.46;
                        break;
                }
                if(peopleCount >= 30)
                {
                    price -= price * 0.15;
                }
            }
            else if(typeGroup == "Business")
            {
                if(peopleCount >= 100)
                {
                    peopleCount -= 10;
                }
                switch (day)
                {
                    case "Friday":
                        price = peopleCount * 10.90;
                        break;
                    case "Saturday":
                        price = peopleCount * 15.60;
                        break;
                    case "Sunday":
                        price = peopleCount * 16;
                        break;
                }
                
            }
            else
            {
                switch (day)
                {
                    case "Friday":
                        price = peopleCount * 15;
                        break;
                    case "Saturday":
                        price = peopleCount * 20;
                        break;
                    case "Sunday":
                        price = peopleCount * 22.50;
                        break;
                }
                if(peopleCount >= 10 && peopleCount <= 20)
                {
                    price -= price * 0.05;
                }
            }
            Console.WriteLine($"Total price: {price:F2}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace P06.SpeedRacing
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            HashSet<Car> cars = new HashSet<Car>();
            for (int i = 0; i < n; i++)
            {
                string[] carArgs = Console.ReadLine()
                    .Split();
                string model = carArgs[0];
                double fuelAmount = double.Parse(carArgs[1]);
                double fuelConsPerKm = double.Parse(carArgs[2]);

                Car car = new Car(model, fuelAmount, fuelConsPerKm);
                /////TO CHECK IF THERE IS A CAR WITH THE SAME MODEL
                cars.Add(car);

            }

            string command;
            while((command = Console.ReadLine()) != "End")
            {
                string[] driveArgs = command
                    .Split();

                string carModel = driveArgs[1];
                int amountOfKm = int.Parse(driveArgs[2]);

                var searchedCar = cars.First(c => c.Model == carModel);

                searchedCar.Drive(amountOfKm);
            }

            foreach (var car in cars)
            {
                Console.WriteLine($"{car.Model} {car.FuelAmount:F2} {car.TravelledDistance}");
            }
        }
    }
}
<file_sep>﻿using System;

namespace Methods
{
    class Program
    {
        
        /// overloading func - 2 or more functions with the same name doing the same thing with different types of parameters
        ///recoursing - to call the func in the same func
        
        static void Main(string[] args)
        {
            //int a = 4; int b = 7;
            int sum = SumNumbers(5,6);
            Console.WriteLine(sum);
        }
        
         
        static int SumNumbers(int num1 , int num2)
        {
            //Console.WriteLine("Hello!");
            return num1 + num2;
        }

        static double SumNumbers(double num1,double num2)
        {
            return num1 + num2;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _09.Pokemon_Don_t_Go
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            List<int> removedList = new List<int>();

            while (list.Count > 0)
            {
                int index = int.Parse(Console.ReadLine());
                if (index < 0)
                { 
                    removedList.Add(list[0]);
                    int removed = list[0];
                   // index = 0;
                    list.RemoveAt(0);                  
                    list.Insert(0, list[list.Count - 1]);
                    for (int i = 0; i < list.Count; i++)
                    {
                        //if (i == index)
                        //{
                        //    continue;
                        //}
                        if (list[i] <= removed)
                        {
                            list[i] += removed;
                        }
                        else if (list[i] > removed)
                        {
                            list[i] -= removed;
                        }
                    }
                    continue;
                    //
                }
                else if(index > list.Count - 1)
                {
                    removedList.Add(list[list.Count - 1]);
                    int removed = list[list.Count - 1];
                   // index = 
                    list.RemoveAt(list.Count - 1);
                    list.Add(list[0]);

                    for (int i = 0; i < list.Count; i++)
                    {
                        //if (i == index)
                        //{
                        //    continue;
                        //}
                        if (list[i] <= removed)
                        {
                            list[i] += removed;
                        }
                        else if (list[i] > removed)
                        {
                            list[i] -= removed;
                        }
                    }
                    continue;

                    //
                }
                else{
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (i == index)
                        {
                            continue;
                        }
                        if (list[i] <= list[index])
                        {
                            list[i] += list[index];
                        }
                        else if (list[i] > list[index])
                        {
                            list[i] -= list[index];
                        }
                    }
                    removedList.Add(list[index]);
                list.RemoveAt(index);
                }
                
                
            }
            Console.WriteLine(removedList.Sum());
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P05.BirthdayCelebrations
{
    interface IIdentifiable
    {
        string GetId();
    }
}
<file_sep>﻿using System;
using System.Linq;
namespace MultiArraysTry
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] matrix = { {1,2,3,4},{5,6,7,8} };
           /////Accesing elements of the array
           // Console.WriteLine(matrix[1, 2]);
            ///array.GetLenght(dimension)

            /////Printing the multidimensional arrays
            for (int row = 0; row < matrix.GetLength(0); row++)
            {
                for (int col = 0; col < matrix.GetLength(1); col++)
                {
                    Console.Write($"{matrix[row, col]} ");
                }
            }
            Console.WriteLine("");
            Console.WriteLine("SECOND METHOD FOR PRINTING THIS TYPE OF ARRAY");

            foreach(int el in matrix)
            {
                Console.Write($"{el} ");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _06._Reverse_And_Exclude
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> numbers = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToList();
            int n = int.Parse(Console.ReadLine());

            Predicate<int> isDivisable = new Predicate<int>((num) => num % n == 0);

            var ReverseAndRemovesDivisableNums = new Func<List<int>, List<int>>((list) =>
             {
                 list.Reverse();
                 for (int i = 0; i < list.Count; i++)
                 {
                     if (isDivisable(list[i]))
                     {
                         list.Remove(list[i]);
                         i--;
                     }
                 }
                 return list;
             });

            numbers = ReverseAndRemovesDivisableNums(numbers);
            Console.WriteLine(string.Join(" ",numbers));

        }
    }
}
<file_sep>﻿using System;

namespace Yardgreening
{
    class Program
    {
        static void Main(string[] args)
        {
            double kvMetri = double.Parse(Console.ReadLine());
            double priceWithoutdiscount = kvMetri * 7.61;
            double discount = priceWithoutdiscount * 0.18;
            double res = priceWithoutdiscount - discount;

            Console.WriteLine($"The final price is: {res} lv.");
            Console.WriteLine($"The discount is: {discount} lv.");
            
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace JaggedArray
{
    class Program
    {
        static void Main(string[] args)
        {
            //int[][] array = new int[4][];

            //array[0] = new int[3];
            //array[1] = new int[2];
            //array[2] = new int[4];
            //array[3] = new int[1];

            /////FILLING JAGGED ARRAY
            ///

            /*
            1 2 3 4
            5 6
            7 8 9 10 11
                */


            int rows = int.Parse(Console.ReadLine());


            int[][] array = new int[rows][];

            for (int row = 0; row < rows; row++)
            {
                int[] currentRow = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                array[row] = currentRow;

            }
            for (int row = 0; row < array.Length; row++)
            {
                int[] currentRow = array[row];
                for (int col = 0; col < currentRow.Length; col++)
                {
                    Console.Write(array[row][col] + " ");
                }
                Console.WriteLine();
            }
        }
    }
}
<file_sep>﻿using System;

namespace Class_Abstraction
{
   
    ///abstract///keyword for methods and classes //abstract class - restricted class(to use it must be in inherited from
    //another class) // abstract method - can be used only in abstract class and dont have a body ;the body is provided
    // by the derived class 
   
     

    abstract class Animal
    {
        public abstract void animalSound();

        public void sleep()
        {
            Console.WriteLine("zzzz");
        }

    }
    class Pig : Animal
    {
        public override void animalSound()
        {
            Console.WriteLine("The pig says wee wee");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Pig myPig = new Pig();
            myPig.animalSound();
            myPig.sleep();  
        }
    }
}
<file_sep>﻿namespace _3._Raiding.Contracts
{
   public  interface ICastAbilitable
    {
        public string CastAbility();
    }
}
<file_sep>﻿namespace Aquariums.Tests
{
    using NUnit.Framework;
    using System;
    [TestFixture]
    public class AquariumsTests
    {
       [Test]
        public void ConstructorShouldInicialiseCorrectlyAllProperties()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 4);

            string expectedName = "Za ribi";
            int expectedCapacity = 4;

            Assert.AreEqual(expectedName, aquarium.Name);
            Assert.AreEqual(expectedCapacity, aquarium.Capacity);
        }
        [TestCase("",4)]
        [TestCase(null, 4)]
        public void ConstructorShouldThrowExceptionIfNameIsNullOrEmpty(string name,int capacity)
        {
            Assert.Throws<ArgumentNullException>(() =>
            {
                Aquarium aquarium = new Aquarium(name, capacity);
            });
        }
        [TestCase("Za ribi",-4)]
        public void ConstructorShouldThrowExceptionIfTheGivenValueIsLowerThanZero(string name, int capacity)
        {
            Assert.Throws<ArgumentException>(() =>
            {
                Aquarium aquarium = new Aquarium(name, capacity);
            });
        }
        [Test]
        public void AddShouldAddFishToTheCollection()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 4);
            int expectedCount = 1;

            aquarium.Add(new Fish("Joro"));

            Assert.AreEqual(expectedCount, aquarium.Count);
        }
        [Test]
        public void AddShouldThrowExceptionIfWetryToAddOverTheCapacity()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 1);

            aquarium.Add(new Fish("Joro"));

            Assert.Throws<InvalidOperationException>(() =>
            {
                aquarium.Add(new Fish("Pesho"));
            });
        }
        [Test]
        public void RemoveFishShouldRemoveFishFromTheCollection()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 1);

            aquarium.Add(new Fish("Joro"));
            aquarium.RemoveFish("Joro");

            Assert.AreEqual(0, aquarium.Count);

        }
        [Test]
        public void RemoveFishShouldThrowExcpetionForInvalidFish()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 1);

            Assert.Throws<InvalidOperationException>(() =>
            {
                aquarium.RemoveFish("Joro");

            });
        }
        [Test]
        public void SellFishShouldReturnRequestedFish()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 1);

            aquarium.Add(new Fish("Joro"));

            Fish returnedFish = aquarium.SellFish("Joro");

            Assert.AreEqual(returnedFish.Name, "Joro");
        }
        [Test]
        public void SellFishShouldThrowExcpetionIfFishWithThisNameDoesntExist()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 1);

            aquarium.Add(new Fish("Joro"));

            Assert.Throws<InvalidOperationException>(() =>
            {
                Fish returnedFish = aquarium.SellFish("Gosho");
            });
        }
        [Test]
        public void ReportShouldWorkCorrectly()
        {
            Aquarium aquarium = new Aquarium("Za ribi", 1);

            aquarium.Add(new Fish("Joro"));

            string report = aquarium.Report();

            Assert.AreEqual("Fish available at Za ribi: Joro", report);
        }
    }
}
<file_sep># C# Related
  Some of excercises I made, while learning C#
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04._BorderControl.Contracts
{
    public interface IRobot
    {
        string Model { get; }
        string Id { get; }
    }
}
<file_sep>﻿using System;
using System.Linq;
using System.Reflection;

namespace _02._Shoot_for_the_Win
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] targets = Console.ReadLine()
                .Split(' ',StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();
            int countShotTargets = 0;

            string command;
            while((command = Console.ReadLine()) != "End")
            {
                int indexToShoot = int.Parse(command);
                
                if(indexToShoot < 0 || indexToShoot >= targets.Length || targets[indexToShoot] == -1)
                {
                    continue;
                }

                int shotTargetValue = targets[indexToShoot];
                targets[indexToShoot] = -1;
                countShotTargets++;

                for(int i = 0; i < targets.Length; i++)
                {
                    if(targets[i] > shotTargetValue)
                    {
                        targets[i] -= shotTargetValue;
                    }
                    else if(targets[i] <= shotTargetValue && targets[i] != -1)
                    {
                        targets[i] += shotTargetValue;
                    }
                }
            }

            Console.WriteLine($"Shot targets: {countShotTargets} -> {string.Join(' ',targets)}");

        }
    }
}
<file_sep>﻿using P07.MilitaryElite.Enumerations;
using System;
using System.Collections.Generic;
using System.Text;

namespace P07.MilitaryElite.Contracts
{
    public interface ISpecialisedSoldier : IPrivate
    {
        Corps Corps { get; }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Interfaces_and_Abstraction
{
    public interface IMovable
    {
        void Move(int x, int y); 
    }
}
<file_sep>﻿using System;

namespace Poke_Mon
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int M = int.Parse(Console.ReadLine());
            int Y = int.Parse(Console.ReadLine());

            int nOrigin = N;
            int countPoked = 0;
            while (N >= M)
            {
                if (N == 0.5 * nOrigin)
                {
                    if (Y > 0)
                    { 
                        N /= Y; 
                        if(N < M)
                            {
                            break;
                            }
                    }
                }
                
                        N -= M;
                        countPoked++;
                    
                
            }
            Console.WriteLine(N);
            Console.WriteLine(countPoked);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P08.CollectionHierarchy.Contracts
{
    public interface IRemovable : IAddable
    {
        void Remove();
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _03._Heart_Delivery
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Console.ReadLine().Split('@', StringSplitOptions.RemoveEmptyEntries)
                                          .Select(int.Parse)
                                          .ToArray();

            int indexOfCupid = 0;
            string input;
            while((input = Console.ReadLine()) != "Love!")
            {
                string[] command = input.Split();
                int jumpLength = int.Parse(command[1]);
                
                if(indexOfCupid + jumpLength < arr.Length && arr[indexOfCupid + jumpLength] != 0)
                {
                    indexOfCupid += jumpLength;
                    arr[indexOfCupid] -= 2;
                    if(arr[indexOfCupid] == 0)
                    {
                        Console.WriteLine($"Place {indexOfCupid} has Valentine's day.");
                    }

                }
                else if(indexOfCupid + jumpLength < arr.Length &&  arr[indexOfCupid + jumpLength] == 0)
                {
                    indexOfCupid += jumpLength;
                    Console.WriteLine($"Place {indexOfCupid} already had Valentine's day.");
                }
                else
                {
                    indexOfCupid = 0;
                    if(arr[indexOfCupid] == 0)
                    {
                        Console.WriteLine($"Place {indexOfCupid} already had Valentine's day.");
                    }
                    else
                    {
                        arr[indexOfCupid] -= 2;
                        if (arr[indexOfCupid] == 0)
                        {
                            Console.WriteLine($"Place {indexOfCupid} has Valentine's day.");
                        }
                    }
                }
            }
            Console.WriteLine($"Cupid's last position was {indexOfCupid}.");
            if(arr.All(h => h == 0))
            {
                Console.WriteLine($"Mission was successful.");
            }
            else
            {
                int countFailedHouses = arr.Count(h => h != 0);
                Console.WriteLine($"Cupid has failed {countFailedHouses} places.");
            }
        }
    }
}
<file_sep>﻿using System;

namespace PetShop
{
    class Program
    {
        static void Main(string[] args)
        {
            int countDogs = int.Parse(Console.ReadLine());
            int countOther = int.Parse(Console.ReadLine());

            double neededMoney = countDogs * 2.50 + countOther * 4;
            Console.WriteLine($"{neededMoney} lv.");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _07._The_V_Logger
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, HashSet<string>> vloggerWithHisFollowers = new
                Dictionary<string, HashSet<string>>();

            Dictionary<string, HashSet<string>> vloggerWithHisFowolling = new
                Dictionary<string, HashSet<string>>();

            string command;
            while((command = Console.ReadLine()) != "Statistics")
            {
                string[] cmdArgs = command
                    .Split(" ", StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();

                string operation = cmdArgs[1];

                if (operation == "joined")
                {
                    string vloggerToJoin = cmdArgs[0];

                    if (!vloggerWithHisFollowers.ContainsKey(vloggerToJoin))
                    {
                        vloggerWithHisFollowers[vloggerToJoin] = new HashSet<string>();
                        vloggerWithHisFowolling[vloggerToJoin] = new HashSet<string>();
                    }
                }
                else if(operation == "followed")
                {
                    string vloggerWhichFollowed = cmdArgs[0];
                    string vloggerFollowed = cmdArgs[2];
                    if(vloggerWithHisFollowers.ContainsKey(vloggerWhichFollowed) 
                        && vloggerWithHisFowolling.ContainsKey(vloggerFollowed)
                        && vloggerFollowed != vloggerWhichFollowed
                        && !vloggerWithHisFowolling[vloggerWhichFollowed].Contains(vloggerFollowed))
                    {
                        ///For the vlogger which followed the other one
                        vloggerWithHisFowolling[vloggerWhichFollowed].Add(vloggerFollowed);
                        ///For the followed vlogger
                        vloggerWithHisFollowers[vloggerFollowed].Add(vloggerWhichFollowed);
                    }
                }
            }
            //Ordering dict to be ordered by count of followers
            vloggerWithHisFollowers = vloggerWithHisFollowers
                .OrderByDescending(kvp => kvp.Value.Count)
                .ThenBy(kvp => vloggerWithHisFowolling[kvp.Key].Count)
               // .ThenBy(kvp => vloggerWithHisFowolling[kvp.Key].Count)
                .ToDictionary(x => x.Key, y => y.Value);

            //vloggerWithHisFowolling = vloggerWithHisFowolling
            //    .OrderBy(kvp => kvp.Value.Count)
            //    .ThenBy(kvp => kvp.Value)
            //    .ToDictionary(x => x.Key, y => y.Value);
            /////

            //Best vlogger
            Console.WriteLine($"The V-Logger has a total of {vloggerWithHisFollowers.Count} vloggers in its logs.");
            Console.WriteLine($"1. {vloggerWithHisFollowers.First().Key}" +
                $" : {vloggerWithHisFollowers.First().Value.Count} followers," +
                $" {vloggerWithHisFowolling[vloggerWithHisFollowers.First().Key].Count} following");
            foreach (var follower in vloggerWithHisFollowers.First().Value.OrderBy(s => s))
            {
                Console.WriteLine($"*  {follower}");
            }
            /////The other vloggers
            int counter = 0;
            foreach (var kvp in vloggerWithHisFollowers)
            {
                if(counter == 0)
                {
                    counter++;
                    continue;
                }
                Console.WriteLine($"{counter + 1}. {kvp.Key} : {kvp.Value.Count} followers," +
                    $" {vloggerWithHisFowolling[kvp.Key].Count} following");

                counter++;
            }
        }
    }
}
<file_sep>﻿using System;

namespace FishingBoat
{
    class Program
    {
        static void Main(string[] args)
        {
            int budget = int.Parse(Console.ReadLine());
            string season = Console.ReadLine();
            int countFisherman = int.Parse(Console.ReadLine());

            double moneyNeeded = 0.0;

            switch(season)
            {
                case "Spring":
                    moneyNeeded = 3000;                 
                   
                    break;
                case "Summer":
                   
                   // break;

                case "Autumn":
                    moneyNeeded = 4200;
                 
                    break;

                case "Winter":
                    moneyNeeded = 2600;
                                  
                    break;
                
                  
            }
                if (countFisherman <= 6)
                {
                    moneyNeeded = moneyNeeded - moneyNeeded * 0.1;
                }
                else if (countFisherman >= 7 && countFisherman <= 11)
                {
                    moneyNeeded = moneyNeeded - moneyNeeded * 0.15;
                }
                else if (countFisherman >= 12)
                {
                    moneyNeeded = moneyNeeded - moneyNeeded * 0.25;
                }
            

                if (countFisherman % 2 == 0 && season!="Autumn")
                {
                moneyNeeded = moneyNeeded - moneyNeeded * 0.05;
                }
          //  Console.WriteLine(moneyNeeded);
            if (budget >= moneyNeeded)
            {
                Console.WriteLine($"Yes! You have {budget - moneyNeeded:F2} leva left.");
            }
            else if(budget < moneyNeeded)
            {
                Console.WriteLine($"Not enough money! You need {moneyNeeded - budget:F2} leva.");
            }

        }
    }
}
<file_sep>﻿using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
           // Console.WriteLine("Hello SoftUni");

            /* string name = "Vladi ";
             string family_name = "Kolev";
             string fullname = name + family_name;
             Console.WriteLine(fullname);
             Console.WriteLine(name + family_name);*/

            /*            Console.WriteLine("ENter user:");
                        string user = Console.ReadLine();
                        Console.WriteLine("Username is " + user);*/


            /* Console.WriteLine("Enter AGE:");
             int age = Convert.ToInt32(Console.ReadLine());
             Console.WriteLine("Age e " + age);
             */

            /* int x = 4;
            // int y = 6;int z = 4;
             Console.WriteLine(Math.Sqrt(x));
             Console.WriteLine(Math.Abs(-4.7));
             Console.WriteLine(Math.Round(9.99));
             */
            string txt = "<NAME>";
            Console.WriteLine(txt.Length);
            txt = txt.ToUpper();
            //Console.WriteLine(txt.ToUpper());
            Console.WriteLine(txt);
            Console.WriteLine(txt.IndexOf("K"));

            int surnamPos = txt.IndexOf("K");
            string lastname = txt.Substring(surnamPos);
            Console.WriteLine(lastname);


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04._BorderControl.Contracts
{
    interface IIdentifiable
    {
        string GetId();
    }
}
<file_sep>﻿using System;

namespace Charity_campaign
{
    class Program
    {
        static void Main(string[] args)
        {
            int dni = int.Parse(Console.ReadLine());
            int brSladkari = int.Parse(Console.ReadLine());
            int brTorti = int.Parse(Console.ReadLine());
            int brGofreti = int.Parse(Console.ReadLine());
            int brPancakes = int.Parse(Console.ReadLine());

            double sumaZaDen = (brTorti * 45 + brGofreti * 5.80 + brPancakes * 3.20)*brSladkari;
            double sumaOtCqlataKampaniq = sumaZaDen * dni;
            double sumaSledPokrivaneNaRazhodi = sumaOtCqlataKampaniq - sumaOtCqlataKampaniq / 8;

            Console.WriteLine(sumaSledPokrivaneNaRazhodi);


        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _6._Jagged_Array_Manipulator
{
    class Program
    {
        static void Main(string[] args)
        {
            int rows = int.Parse(Console.ReadLine());

            double[][] arr = new double[rows][];

            for (int row = 0; row < rows; row++)
            {
                int[] currRow = Console.ReadLine()
                    .Split()
                    .Select(int.Parse)
                    .ToArray();
                arr[row] = new double[currRow.Length];
                for (int col = 0; col < arr[row].Length; col++)
                {
                    arr[row][col] = currRow[col];
                }

            }

            for (int row = 0; row < rows - 1; row++)
            {
                if (arr[row + 1].Length == arr[row].Length)
                {
                    arr[row + 1] = arr[row + 1].Select(x => x * 2).ToArray();
                    arr[row] = arr[row].Select(x => x * 2).ToArray();

                }
                else
                {
                    arr[row + 1] = arr[row + 1].Select(x => x / 2).ToArray();
                    arr[row] = arr[row].Select(x => x / 2).ToArray();
                }
            }

            while (true)
            {
                string command = Console.ReadLine();
                if(command == "End")
                {
                    break;
                }
                string[] cmdArgs = command.Split();
                if(cmdArgs[0] == "Add")
                {
                    int row = int.Parse(cmdArgs[1]);
                    int col = int.Parse(cmdArgs[2]);
                    int value = int.Parse(cmdArgs[3]);
                    if(row >= 0 && row < rows && col >= 0 && col < arr[row].Length)
                    {
                        arr[row][col] += value;
                    }
                }
                else if(cmdArgs[0] == "Subtract")
                {
                    int row = int.Parse(cmdArgs[1]);
                    int col = int.Parse(cmdArgs[2]);
                    int value = int.Parse(cmdArgs[3]);
                    if (row >= 0 && row < rows && col >= 0 && col < arr[row].Length)
                    {
                        arr[row][col] -= value;
                    }
                }
            }

            PrintArr(arr);

        }

        private static void PrintArr(double[][] arr)
        {
            foreach (var row in arr)
            {
                Console.WriteLine(string.Join(" ", row));
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _12._TriFunction
{
    class Program
    {
        static void Main(string[] args)
        {
            int targetSum = int.Parse(Console.ReadLine());
            string[] names = Console.ReadLine()
                .Split();

            Func<string, int, bool> isValidWord = ((name, sum) => name.ToCharArray()
            .Select(ch => (int)ch).Sum() >= sum);

            Func<string[], int, Func<string, int, bool>, string> firstValidName =
                (arr, sum, func) => arr.FirstOrDefault(str => func(str,sum));

            var result = firstValidName(names, targetSum, isValidWord);
            Console.WriteLine(result);

        }
    }
}
<file_sep>﻿using System;

namespace HoneyWinterReserves
{
    class Program
    {
        static void Main(string[] args)
        {
            double honeyNeeded = double.Parse(Console.ReadLine());
            double sumHoney = 0;

            string command = Console.ReadLine();
            while(command != "Winter has come")
            {
                string nameBee = command;
               
                for (int i = 0; i < 6; i++)
                {
                    double honeyThisMonth = double.Parse(Console.ReadLine());
                    sumHoney += honeyThisMonth;
                }
                if(sumHoney < 0)
                {
                    Console.WriteLine($"{nameBee} was banished for gluttony");
                }
                //else if(sumHoney>=honeyNeeded)
                //{
                //    Console.WriteLine($"Well done! Honey surplus {sumHoney - honeyNeeded:F2}.");
                //}
                //else
                //{
                //    Console.WriteLine($"Hard Winter! Honey needed {honeyNeeded - sumHoney:F2}.");
                //}
                if (sumHoney >= honeyNeeded)
                  {
                    Console.WriteLine($"Well done! Honey surplus {sumHoney - honeyNeeded:F2}.");
                    break;
                 }
                command = Console.ReadLine();
            }


            if (sumHoney < honeyNeeded)
            {
                Console.WriteLine($"Hard Winter! Honey needed {honeyNeeded - sumHoney:F2}.");
            }
        }
    }
}
<file_sep>﻿using P08.CollectionHierarchy.Contracts;
using System;
using System.Collections.Generic;
using System.Reflection.Metadata.Ecma335;
using System.Text;

namespace P08.CollectionHierarchy.Models
{
    public class AddRemoveCollection : IRemovable
    {
        private List<string> data;
        private List<int> indexes;
        private List<string> removedElements;

        public AddRemoveCollection()
        {
            this.data = new List<string>();
            this.indexes = new List<int>();
            this.removedElements = new List<string>();
        }
        public void Add(string element)
        {
            this.indexes.Add(0);
            this.data.Insert(0, element);
        }

        public void Remove()
        {
            string lastItem = this.data[this.data.Count - 1];
            this.removedElements.Add(lastItem);
            this.data.RemoveAt(this.data.Count - 1);
        }

        public void GetRemoved()
        {
            Console.WriteLine(string.Join(" ",this.removedElements));
        }
        public override string ToString()
        {
            return $"{string.Join(" ", this.indexes)}";
        }
    }
}
<file_sep>﻿using System;

namespace PasswordGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());

            for(int i=1;i<=n;i++)
            {
                for(int j=1;j<=n;j++)
                {
                    for(int k=97;k<97+l;k++)
                    {
                        for(int m=97;m<97+l;m++)
                        {
                             for(int o=1;o<=n;o++)
                            {
                                if(o > i && o > j)
                                {
                                    Console.Write($"{i}{j}{Convert.ToChar(k)}{Convert.ToChar(m)}{o} ");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cars
{
    public abstract class Car : ICar
    {
        protected Car(string model,string color)
        {
            this.Model = model;
            this.Color = color;
        }

        public string Model { get; private set; }

        public string Color { get; private set; }

        public abstract string Start();
        

        public string Stop()
        {
            return "Stopped";
        }
    }
}
<file_sep>﻿using System;

namespace Deposit_calculator
{
    class Program
    {
        static void Main(string[] args)
        {
            double deposiranasuma = double.Parse(Console.ReadLine());
            int srok =int.Parse(Console.ReadLine());
            double godLihvenProcent = double.Parse(Console.ReadLine());
           // Console.WriteLine(godLihvenProcent*deposiranasuma/100);

            double res = deposiranasuma + srok * ((deposiranasuma * godLihvenProcent/100) / 12);
            Console.WriteLine(res);

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Inheritance
{
    public class Doctor:Employee
    {
        public List<string> Patients { get; set; }

    }
}
<file_sep>﻿using System;
using System.Text;
using System.Text.RegularExpressions;

namespace _02._Problem
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            string pattern = @"(.+)>(?<first>\d{3})\|(?<second>[a-z]{3})\|(?<third>[A-Z]{3})\|(?<fourth>[^\n]{3})<(\1)";

            for (int i = 0; i < n; i++)
            {
                string currPass = Console.ReadLine();
                if(Regex.IsMatch(currPass, pattern))
                {
                    Match match = Regex.Match(currPass, pattern);
                    StringBuilder sb = new StringBuilder();

                    sb.Append(match.Groups["first"].Value);
                    sb.Append(match.Groups["second"].Value);
                    sb.Append(match.Groups["third"].Value);
                    sb.Append(match.Groups["fourth"].Value);

                    Console.WriteLine($"Password: {sb.ToString()}");
                }
                else
                {
                    Console.WriteLine("Try another password!");
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            ///string - referent type
            ///string - immutable;///They are read only 
            string text = "Exam";
            string newText = "Retake Exam";
            string third= String.Concat(text, newText);

            string txt = new string(new char[] { '1', '2', '3', '4' });
            Console.WriteLine(txt.ToCharArray());


            string texte = "Hello, from, Softuni, my name, is ,Pesho";
            int indexOfComma = texte.LastIndexOf(',');
            Console.WriteLine(indexOfComma);


            ///Substring
            string substring = texte.Substring(texte.Length-6);
            //text.IndexOf(', ', )
            string substring2 = new string(texte.Reverse().ToArray());

            Console.WriteLine(substring);

            ////Split()
            ///
            char[] separators = { '!', ',' };
            string[] words = text.Split(separators);


        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace Order_By
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split().ToList();

            input = input
                .OrderBy(x => x[0])
                .ThenByDescending(x => x.Length)
                .ToList();

            Console.WriteLine(string.Join(" ", input));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public class AirFighter : Airplane
    {
        public int Damage { get; set; }

        public override string VrumVrum()
        {
            return "Fighter is fighting";
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace Jagged___Array_Modification
{
    class Program
    {
        static void Main(string[] args)
        {
            int rows = int.Parse(Console.ReadLine());

            int[][] array = new int[rows][];

            for (int row = 0; row < rows; row++)
            {
                int[] currentRow = Console.ReadLine()
                    .Split()
                    .Select(int.Parse)
                    .ToArray();

                array[row] = currentRow;
            }

            while (true)
            {
                string command = Console.ReadLine().ToLower();


                if(command == "end")
                {
                    break;
                }

                string[] cmdArgs = command.Split();

                if(rows<)

                if (cmdArgs[0] == "add")
                {
                }
                else if(cmdArgs[0] == "subtract")
                {

                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _03.Extract_File
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = Console.ReadLine();

            string[] pathArgs = path
                .Split('\\', StringSplitOptions.RemoveEmptyEntries)
                .ToArray();

            string[] fileInfo = pathArgs.Last()
                .Split('.');


            string[] filenameArgs =fileInfo.Take(fileInfo.Length - 1)
                .ToArray();


            string fileName = string.Join(".", filenameArgs);
            string fileExtension = fileInfo.Last();

            Console.WriteLine($"File name: {fileName}");
            Console.WriteLine($"File extension: {fileExtension}");
        }
    }
}
<file_sep>﻿using System;
using System.Numerics;

namespace _3.Big_Factorial
{
    class Program
    {
        static void Main(string[] args)
        {
            int number = int.Parse(Console.ReadLine());
            BigInteger bigInteger = 1;
            //50

            //50* 49 * 48

            for (int i = number ; i > 0; i--)
            {
                bigInteger *= i;
            }
            Console.WriteLine(bigInteger);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _06._Courses
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, List<string>> courses = new Dictionary<string, List<string>>();

            while (true)
            {
                string inp = Console.ReadLine();
                if(inp == "end")
                {
                    break;
                }
                string[] command = inp.Split(" : ");

                string courseName = command[0];
                string studentName = command[1];
                if (!courses.ContainsKey(courseName))
                {
                    courses[courseName] = new List<string>();
                  //  courses[courseName].Add(studentName);
                }
                courses[courseName].Add(studentName);
            }

            Dictionary<string, List<string>> sortedCourses = courses
                .OrderByDescending(kvp => kvp.Value.Count)
                .ToDictionary(a => a.Key, b => b.Value);

            foreach (var kvp in sortedCourses)
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value.Count}");
                foreach (var student in kvp.Value.OrderBy(n => n))
                {
                    Console.WriteLine($"-- {student}");
                }
            }
                
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace SquareWithMaximumSum
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] sizes = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();

            int[,] matrix = new int[sizes[0],sizes[1]];

            for(int row =0;row<matrix.GetLength(0);row++)
            {
                int[] colElem = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
                for(int col = 0; col < matrix.GetLength(1);col++)
                {
                    matrix[row, col] = colElem[col];
                }
            }
            int maxSum = int.MinValue;
            int maxRow = 0;
            int maxCol = 0;
            for(int row =0;row< matrix.GetLength(0)-1;row++)
            {
                for (int col = 0; col < matrix.GetLength(1)-1; col++)
                {
                    int currentSum = matrix[row, col]
                        + matrix[row, col + 1]
                        + matrix[row + 1, col]
                        + matrix[row + 1, col + 1];
                     if(currentSum> maxSum)
                    {
                        maxSum = currentSum;
                        maxRow = row;
                        maxCol = col;
                    }
                    
                }

               

            } Console.WriteLine($"{matrix[maxRow, maxCol]} {matrix[maxRow, maxCol + 1]}");
              Console.WriteLine($"{matrix[maxRow+1, maxCol]} {matrix[maxRow+1, maxCol + 1]}");
            Console.WriteLine(maxSum);

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._Warships
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            char[,] field = new char[n, n];



            string[] commmands = Console.ReadLine().Split(",", StringSplitOptions.RemoveEmptyEntries).ToArray();

            for (int i = 0; i < n; i++)
            {
                char[] row = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries).Select(char.Parse).ToArray();
                for (int j = 0; j < n; j++)
                {
                    field[i, j] = row[j];
                }
            }
            // int countDestrByP1 = 0;
            // int countDestrByP2 = 0;'
            int countDestr = 0;
            int countP1Ships = 0;
            int countP2Ships = 0;

            countP1Ships = GetCountP1Ships(n, field, countP1Ships);
            countP2Ships = GetCountP2Ships(n, field, countP2Ships);

            for (int i = 0; i < commmands.Length; i++)
            {
                int x, y;
                /*if (commmands[i].Length == 1)
                {
                    x = int.Parse(commmands[i]);
                    y = int.Parse(commmands[i]);
                }
                */
               // else
                //{

                    int[] coordinates = commmands[i].Split(" ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
                    x = coordinates[0];
                    y = coordinates[1];

                //}


                if (x < 0 || x >= n || y < 0 || y >= n)
                {
                    continue;
                }
                ///player 1
                if (i % 2 == 0)
                {
                    commandsForP1(n, field, ref countDestr, ref countP1Ships, ref countP2Ships, x, y, true);
                }
                //p2
                else
                {
                    commandsForP1(n, field, ref countDestr, ref countP1Ships, ref countP2Ships, x, y, false);

                }
                if (countP1Ships == 0)
                {
                    Console.WriteLine($"Player Two has won the game! {countDestr} ships have been sunk in the battle.");
                    break;
                }
                else if (countP2Ships == 0)
                {
                    Console.WriteLine($"Player One has won the game! {countDestr} ships have been sunk in the battle.");
                    break;
                }

            /*    Console.WriteLine();
                PrintField(n, field);
              */ 

            }
            Console.WriteLine();
            PrintField(n, field);
            
            if (countP1Ships != 0 && countP2Ships != 0)
            {
                Console.WriteLine($"It's a draw! Player One has {countP1Ships} ships left. Player Two has {countP2Ships} ships left.");
            }

        }

       
        private static void commandsForP1(int n, char[,] field, ref int countDestr, ref int countP1Ships, ref int countP2Ships, int x, int y, bool isP1)
        {
            if(isP1 == true)
            {
                if (field[x, y] == '>')
                {
                    countDestr++;
                    field[x, y] = 'X';
                    countP2Ships--;
                }
            }
            else
            {
                if (field[x, y] == '<')
                {
                    countDestr++;
                    field[x, y] = 'X';
                    countP1Ships--;
                }
            }
            if (field[x, y] == '#')
            {
                //up
                if (x - 1 >= 0)
                {
                    if (field[x - 1, y] == '>')
                    {
                        countDestr++;
                        countP2Ships--;

                        field[x - 1, y] = 'X';
                    }
                    else if (field[x - 1, y] == '<')
                    {
                        countDestr++;
                        countP1Ships--;

                        field[x - 1, y] = 'X';
                    }

                    //up right
                    if (y + 1 < n)
                    {
                        if (field[x - 1, y + 1] == '>')
                        {
                            countDestr++;
                            countP2Ships--;

                            field[x - 1, y + 1] = 'X';
                        }
                        else if (field[x - 1, y + 1] == '<')
                        {
                            countDestr++;
                            countP1Ships--;

                            field[x - 1, y + 1] = 'X';
                        }
                    }
                    //up left
                    if (y - 1 >= 0)
                    {
                        if (field[x - 1, y - 1] == '>')
                        {
                            countDestr++;
                            countP2Ships--;

                            field[x - 1, y - 1] = 'X';
                        }
                        else if (field[x - 1, y - 1] == '<')
                        {
                            countDestr++;
                            countP1Ships--;

                            field[x - 1, y - 1] = 'X';
                        }
                    }

                }
                //down
                if (x + 1 < n)
                {
                    if (field[x + 1, y] == '>')
                    {
                        countDestr++;
                        countP2Ships--;


                        field[x + 1, y] = 'X';
                    }
                    else if (field[x + 1, y] == '<')
                    {
                        countDestr++;
                        countP1Ships--;


                        field[x + 1, y] = 'X';
                    }

                    //down right
                    if (y + 1 < n)
                    {
                        if (field[x + 1, y + 1] == '>')
                        {
                            countDestr++;
                            countP2Ships--;

                            field[x + 1, y + 1] = 'X';
                        }
                        else if (field[x + 1, y + 1] == '<')
                        {
                            countDestr++;
                            countP1Ships--;

                            field[x + 1, y + 1] = 'X';
                        }
                    }
                    //down left
                    if (y - 1 >= 0)
                    {
                        if (field[x + 1, y - 1] == '>')
                        {
                            countDestr++;
                            countP2Ships--;

                            field[x + 1, y - 1] = 'X';
                        }
                        else if (field[x + 1, y - 1] == '<')
                        {
                            countDestr++;
                            countP1Ships--;

                            field[x + 1, y - 1] = 'X';
                        }
                    }

                }
                //left
                if (y - 1 >= 0)
                {
                    if (field[x, y - 1] == '>')
                    {
                        countDestr++;
                        countP2Ships--;


                        field[x, y - 1] = 'X';
                    }
                    else if (field[x, y - 1] == '<')
                    {
                        countDestr++;
                        countP1Ships--;


                        field[x, y - 1] = 'X';
                    }
                }
                //right
                if (y + 1 < n)
                {
                    if (field[x, y + 1] == '>')
                    {
                        countDestr++;
                        countP2Ships--;

                        field[x, y + 1] = 'X';
                    }
                    else if (field[x, y + 1] == '<')
                    {
                        countDestr++;
                        countP1Ships--;

                        field[x, y + 1] = 'X';
                    }
                }

                field[x, y] = 'X';
            }
        }

        private static void PrintField(int n, char[,] field)
        {
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    Console.Write(field[i, j]+" ");
                }
                Console.WriteLine();
            }
        }

        private static int GetCountP2Ships(int n, char[,] field, int countP2Ships)
        {
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (field[i, j] == '>')
                    {
                        countP2Ships++;
                    }
                }
            }

            return countP2Ships;
        }

        private static int GetCountP1Ships(int n, char[,] field, int countP1Ships)
        {
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (field[i, j] == '<')
                    {
                        countP1Ships++;
                    }
                }
            }

            return countP1Ships;
        }
    }
}
<file_sep>﻿using System;

namespace _01._Disneyland_Journey
{
    class Program
    {
        static void Main(string[] args)
        {
            double moneyNeeded = double.Parse(Console.ReadLine());
            int months = int.Parse(Console.ReadLine());

            double collectedMoney = 0;
            for (int i = 0; i < months; i++)
            {
                if((i+1) != 1 && (i + 1) % 2 != 0)
                {
                    collectedMoney -= collectedMoney * 0.16;
                }
                if((i+1) % 4 == 0)
                {
                    collectedMoney += collectedMoney * 0.25;
                }
                collectedMoney += 0.25 * moneyNeeded;
            }

            if(collectedMoney >= moneyNeeded)
            {
                Console.WriteLine($"Bravo! You can go to Disneyland and you will have {collectedMoney-moneyNeeded:F2}lv. for souvenirs.");
            }
            else
            {
                Console.WriteLine($"Sorry. You need {moneyNeeded - collectedMoney:F2}lv. more.");
            }
        }
    }
}
<file_sep>﻿using System;

namespace ClassProperties
{
    class Person
    {
        private string name = "Private";
        public string Name
        {
            get { return name;  }
            set { name = value;  }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Person first = new Person();
           // first.Name = "Public";
            Console.WriteLine(first.Name);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _02._Odd_Occurrences
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] words = Console.ReadLine().Split();

            Dictionary<string, int> counts = new Dictionary<string, int>();

            for (int i = 0; i < words.Length; i++)
            {
                string word = words[i].ToLower();
                if (!counts.ContainsKey(word))
                {
                    counts[word] = 1;
                }
                else
                {
                    counts[word]++;
                }
            }

            foreach (var item in counts)
            {
                if(item.Value % 2 != 0)
                {
                    Console.Write($"{item.Key} ");
                }
                
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace SumMatrixColumns
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] sizes = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
            int[,] matrix = new int[sizes[0], sizes[1]];

            for(int row=0;row<matrix.GetLength(0);row++)
            {
                var col = Console.ReadLine().Split().Select(int.Parse).ToArray();
                for(int c = 0;c<matrix.GetLength(1);c++)
                {
                    matrix[row, c] = col[c];
                }
            }

            for(int c=0;c<matrix.GetLength(1);c++)
            {
                int sum = 0;
                for(int r = 0;r<matrix.GetLength(0);r++)
                {
                    sum += matrix[r, c];
                }
                Console.WriteLine(sum);
            }

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _9._Miner
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            char[,] field = new char[n, n];
            string[] commands = Console.ReadLine()
                .Split(' ', StringSplitOptions.RemoveEmptyEntries)
                .ToArray();

            InicialisingField(n, field);

            int minerRow = -1;
            int minerCol = -1;
            FindingWhereisTheMiner(n, field, ref minerRow, ref minerCol);

            int coalsInField = 0;
            coalsInField = FindCountOfCoalsInField(n, field, coalsInField);


            int foundCoals = 0;
            for (int i = 0; i < commands.Length; i++)
            {
                string currCommand = commands[i];
                if (currCommand == "left")
                {
                    if (minerCol - 1 >= 0)
                    {
                        CheckWhatCharItIs(field, minerRow, minerCol - 1,
                           ref minerRow, ref minerCol,ref foundCoals,n);
                    }
                }
                else if (currCommand == "right")
                {
                    if (minerCol + 1 < n)
                    {
                        CheckWhatCharItIs(field, minerRow, minerCol + 1,
                            ref minerRow, ref minerCol,ref foundCoals,n);
                    }
                }
                else if (currCommand == "up")
                {
                    if (minerRow - 1 >= 0)
                    {
                        CheckWhatCharItIs(field, minerRow - 1, minerCol,
                            ref minerRow, ref minerCol,ref foundCoals,n);
                    }
                }
                else if (currCommand == "down")
                {
                    if (minerRow + 1 < n)
                    {
                        CheckWhatCharItIs(field, minerRow + 1, minerCol,
                            ref minerRow, ref minerCol,ref foundCoals,n);
                    }
                }

                if (foundCoals == coalsInField)
                {
                    Console.WriteLine($"You collected all coals! ({minerRow}, {minerCol})");
                    return;
                }
                //Console.WriteLine();
                //PrintField(n, field);
                //Console.WriteLine();
            }

            Console.WriteLine($"{coalsInField - foundCoals} coals left. ({minerRow}, {minerCol})");


        }

        private static void PrintField(int n, char[,] field)
        {
            for (int row = 0; row < n; row++)
            {
                for (int col = 0; col < n; col++)
                {
                    Console.Write(field[row, col] + " ");
                }
                Console.WriteLine();
            }
        }

        private static void CheckWhatCharItIs(char[,] field,int charRow ,
            int charCol ,ref int minerRow,ref int minerCol,ref int foundCoals,int n)
        {
            if(field[charRow,charCol] == '*')
            {
                field[minerRow, minerCol] = '*';
                field[charRow, charCol] = 's';
                minerRow = charRow;
                minerCol = charCol;
               // FindingWhereisTheMiner(n,field,ref minerRow, ref minerCol);
            }
            else if(field[charRow, charCol] == 'c')
            {
                foundCoals++;
                field[minerRow, minerCol] = '*';
                field[charRow, charCol] = 's';
                minerRow = charRow;
                minerCol = charCol;
                //FindingWhereisTheMiner(n, field, ref minerRow, ref minerCol);

            }
            else if(field[charRow, charCol] == 'e')
            {
                minerRow = charRow;
                minerCol = charCol;
                field[charRow, charCol] = 's';
                Console.WriteLine($"Game over! ({minerRow}, {minerCol})");
                Environment.Exit(0);
            }
        }

        private static void FindingWhereisTheMiner(int n, char[,] field, ref int minerRow, ref int minerCol)
        {
            for (int row = 0; row < n; row++)
            {
                for (int col = 0; col < n; col++)
                {
                    if (field[row, col] == 's')
                    {
                        minerRow = row;
                        minerCol = col;
                    }
                }
            }
        }

        private static int FindCountOfCoalsInField(int n, char[,] field, int coalsInField)
        {
            for (int row = 0; row < n; row++)
            {
                for (int col = 0; col < n; col++)
                {
                    if (field[row, col] == 'c')
                    {
                        coalsInField++;
                    }
                }
            }

            return coalsInField;
        }

        private static void InicialisingField(int n, char[,] field)
        {
            for (int row = 0; row < n; row++)
            {
                char[] currRow = Console.ReadLine()
                    .Split(' ', StringSplitOptions.RemoveEmptyEntries)
                    .Select(char.Parse)
                    .ToArray();
                for (int col = 0; col < n; col++)
                {
                    field[row, col] = currRow[col];
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cars
{
    public class Battery
    {

    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _10.LadyBugs
{
    class Program
    {
        static void Main(string[] args)
        {
            int size = int.Parse(Console.ReadLine());
            int[] field = new int[size];
            //  field = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] IndexesWithBees = Console.ReadLine().Split().Select(int.Parse).ToArray();

            for (int i = 0; i < IndexesWithBees.Length; i++)
            {
                if (IndexesWithBees[i] < field.Length&& IndexesWithBees[i] >= 0)
                {
                    field[IndexesWithBees[i]] = 1;
                }
            }
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "end")
                {
                    break;
                }

                string[] command = input.Split();
                int ladybugIndex = int.Parse(command[0]);
                string direction = command[1];
                int flyLength = int.Parse(command[2]);
                //  Console.WriteLine(ladybugIndex + direction + flyLength);
                if (field[ladybugIndex] == 1 && ladybugIndex < field.Length && ladybugIndex >= 0
                    && flyLength != 0)
                {
                    field[ladybugIndex] = 0;
                    if (direction == "right")
                    {
                        if ((ladybugIndex + flyLength) < size
                             && ladybugIndex + flyLength >= 0
                            && field[ladybugIndex + flyLength] == 0)
                        {
                            //if (field[ladybugIndex + flyLength] != 1)
                            //{
                            field[ladybugIndex + flyLength] = 1;
                            //}
                        }
                        /////////Problemno
                        else if (ladybugIndex + flyLength < field.Length
                             && ladybugIndex + flyLength >= 0 &&
                            field[ladybugIndex + flyLength] == 1)
                             {
                            //if ((ladybugIndex + flyLength + ladybugIndex+ flyLength) < size)
                            //{
                            ///    field[ladybugIndex + flyLength + ladybugIndex + flyLength] = 1;
                            //}
                            while (ladybugIndex + flyLength < field.Length
                              && ladybugIndex + flyLength >= 0
                              && field[ladybugIndex + flyLength] == 1) //продължава напред със същия брой движения ДОКАТО не открие празно място
                            {
                                flyLength += flyLength; //затова увеличаваме хода със същия брой движения
                                if (ladybugIndex + flyLength < field.Length
                                    && ladybugIndex + flyLength >= 0 // а тази проверка е в случай, че числото е ОТРИЦАТЕЛНО, за да не излезе от полето НАЛЯВО
                                    && field[ladybugIndex + flyLength] == 0)
                                {
                                    field[ladybugIndex + flyLength] = 1; //ако открие празна позиция, я заема
                                    break; //и излизаме от while-цикъла
                                }
                            }

                            }
                    }
                }
                else if (direction == "left")
                {

                    if ((ladybugIndex - flyLength) >= 0 && ladybugIndex - flyLength < field.Length 
                        && field[ladybugIndex - flyLength] == 0)
                    {
                        //if (field[ladybugIndex - flyLength] != 1)
                        //{
                        field[ladybugIndex - flyLength] = 1;
                        //}
                    }
                    /////////Problemno
                    else if (field[ladybugIndex - flyLength] == 1 && ladybugIndex - flyLength >= 0
                                 && ladybugIndex - flyLength < field.Length)
                    {
                        //    if ((ladybugIndex - flyLength - ladybugIndex - flyLength) >= 0)
                        //    {
                        //        field[ladybugIndex - flyLength - ladybugIndex - flyLength] = 1;
                        //    }
                        while (ladybugIndex - flyLength >= 0 // ДОКАТО (while) не открие празна позиция
                              && ladybugIndex - flyLength < field.Length
                              && field[ladybugIndex - flyLength] == 1)
                        {
                            flyLength += flyLength; // тук си е плюс, а не минус, въпреки че е наляво, но... за да не ходи напред-назад
                            if (ladybugIndex - flyLength >= 0
                                && ladybugIndex - flyLength < field.Length
                                && field[ladybugIndex - flyLength] == 0)
                            {
                                field[ladybugIndex - flyLength] = 1;
                                break;
                            }
                        }

                    
                    }



                }
            }
                Console.WriteLine(string.Join(" ", field));
            
        }
    }
}
<file_sep>﻿using P04._BorderControl.Contracts;
using System;
using System.Collections.Generic;
using System.Text;

namespace P04._BorderControl.Models
{
    public class Citizen :  IIdentifiable
    {
        private string name;
        private int age;
        private string id;
        public Citizen(string name, int age, string id)
        {
            this.name = name;
            this.age = age;
            this.id = id;
        }
       // public string Name { get; }

        //public int Age { get; }

        //public string Id { get; }

        public string GetId()
        {
            return this.id;
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace _10._Crossroads
{
    class Program
    {
        static void Main(string[] args)
        {
            int durationOfGreenLight = int.Parse(Console.ReadLine());
            int durationOfFreeWindow = int.Parse(Console.ReadLine());

            Queue<string> cars = new Queue<string>();

            bool crashed = false;
            string crashedCar = string.Empty;
            int hitIndex = -1;
            int totalCarsPassed = 0;

            string command;
            while((command = Console.ReadLine()) != "END")
            {
                if (command == "green")
                {
                    int currentGreenLight = durationOfGreenLight;
                    while (cars.Any() && currentGreenLight > 0)
                    {
                        string currCar = cars.Peek();
                        int carLength = currCar.Length;

                        if (carLength <= currentGreenLight )
                        {
                            totalCarsPassed++;
                            currentGreenLight -= currCar.Length;
                            cars.Dequeue();
                        }
                        else
                        {
                            carLength -= currentGreenLight;
                            if (carLength <= durationOfFreeWindow)
                            {
                                totalCarsPassed++;
                                cars.Dequeue();
                            }
                            else
                            {
                                crashed = true;
                                crashedCar = currCar;
                                hitIndex = currentGreenLight
                                    + durationOfFreeWindow;
                            }
                                break;
                        }
                        
                    }
                    
                }
                else
                {
                    cars.Enqueue(command);
                }
                if (crashed)
                {
                    break;
                }
            }
            if (crashed)
            {
                Console.WriteLine("A crash happened!");
                Console.WriteLine($"{crashedCar} was hit at {crashedCar[hitIndex]}.");
            }
            else
            {
                Console.WriteLine("Everyone is safe.");
                Console.WriteLine($"{totalCarsPassed} total cars passed the crossroads.");
            }
        }
    }
}
<file_sep>﻿using P03.Raiding.Models;
using P03.Raiding.Models.Factory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P03.Raiding.Core
{
    public class Engine 
    {
        private ICollection<BaseHero> heroes;
        private HeroFactory heroFactory;

        public Engine()
        {
            heroes = new List<BaseHero>();
            heroFactory = new HeroFactory();
        }
        public void Run()
        {
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {

                string heroName = Console.ReadLine();
                string heroType = Console.ReadLine();
                //try
                //{
                //    Validate(heroType);
                //}
                //catch (ArgumentException ae)
                //{
                //    Console.WriteLine(ae.Message);
                //    i--;
                //    continue;
                //}
                BaseHero hero;
                try
                {
                     hero = heroFactory.MakeHero(heroName, heroType);
                     heroes.Add(hero);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    i--;
                   
                }
                
                
            }

            int bossPower = int.Parse(Console.ReadLine());
            int sumHeroPower = 0;
            foreach (var hero in heroes)
            {
                Console.WriteLine(hero.CastAbility());
                sumHeroPower += hero.Power;
            }
           // Console.WriteLine(sumHeroPower);
            ResultOfFight(bossPower, sumHeroPower);

        }

        private static void ResultOfFight(int bossPower, int sumHeroPower)
        {
            if (sumHeroPower >= bossPower)
            {
                Console.WriteLine("Victory!");
            }
            else
            {
                Console.WriteLine("Defeat...");
            }
        }

        //private static void Validate(string heroType)
        //{
        //    if (heroType != "Druid" && heroType != "Paladin" && heroType != "Rogue"
        //                        && heroType != "Warrior")
        //    {
        //        throw new ArgumentException("Invalid hero!");
        //    }
        //}
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace _02._Race
{
    class Program
    {
        static void Main(string[] args)
        {

            List<string> names = Console.ReadLine()
                .Split(", ")
                .ToList();

            Dictionary<string, int> racers = new Dictionary<string, int>();

            foreach (string name in names)
            {
                if (!racers.ContainsKey(name))
                {
                    racers[name] = 0;
                }
            }


            while (true)
            {
                string input = Console.ReadLine();
                int distance = 0;
                if (input == "end of race")
                {
                    break;
                }

                string wordPattern = @"[A-Za-z]";
                string name = "";

                var matches = Regex.Matches(input, wordPattern);

                foreach (Match match in matches)
                {
                    name += match.Value;
                }

                if (racers.ContainsKey(name))
                {
                    var matchesDistance = Regex.Matches(input, @"[0-9]");

                    foreach (Match match in matchesDistance)
                    {
                        distance += int.Parse(match.Value);
                    }

                    racers[name] += distance;
                }
            }

            racers = racers
                .OrderByDescending(kvp => kvp.Value)
                .Take(3)
                .ToDictionary(a => a.Key, b => b.Value);

            int counter = 1;
            foreach (var kvp in racers)
            {
                if (counter == 1)
                {
                    Console.WriteLine($"1st place: {kvp.Key}");
                }
                else if (counter == 2)
                {
                    Console.WriteLine($"2nd place: {kvp.Key}");
                }
                else if (counter == 3)
                {
                    Console.WriteLine($"3rd place: {kvp.Key}");
                }
                counter++;
            }
            
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _04.Orders
{
    class Program
    {
        static void Main(string[] args)
        {
            // Dictionary<string,Dictionary<int,int>> d

            Dictionary<string, double> productPrices = new Dictionary<string, double>();
            Dictionary<string, int> productQuant = new Dictionary<string, int>();

            while (true)
            {
                string inp = Console.ReadLine();
                if(inp == "buy")
                {
                    break;
                }

                string[] productArgs = inp.Split().ToArray();

                string name = productArgs[0];
                double price = double.Parse(productArgs[1]);
                int quant = int.Parse(productArgs[2]);

                if (!productQuant.ContainsKey(name))
                {
                    productQuant[name] = 0;
                    productQuant[name] = 0;
                }
                productQuant[name] += quant;
                productPrices[name] = price;

            }

            foreach (var kvp in productPrices)
            {
                string name = kvp.Key;
                double price = kvp.Value;
                int quantity = productQuant[name];

                Console.WriteLine($"{name} -> {price*quantity:F2}");
            }
        }
    }
}
<file_sep>﻿using System;

namespace Vacation_books_list
{
    class Program
    {
        static void Main(string[] args)
        {
            int broiStranici = int.Parse(Console.ReadLine());
            double procheteniZaChas = double.Parse(Console.ReadLine());
            int dniZaKoitoDaGiProchete = int.Parse(Console.ReadLine());

            double ResbroichasovedaOtdeli = (broiStranici / procheteniZaChas)/dniZaKoitoDaGiProchete;
            Console.WriteLine(ResbroichasovedaOtdeli);




        }
    }
}
<file_sep>﻿ using System;
using System.Collections.Generic;

namespace SortingList
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = new List<int>()
           {  1,-1,3,645,34,233};
            Console.WriteLine(string.Join(" ", list));
            list.Sort();
            Console.WriteLine(string.Join(" ", list));
            list.Reverse();
            Console.WriteLine(string.Join(" ", list));

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Encapsulation
{
    public class CommonValidator
    {
        public static void ValidateNull(object value, string name = null)
        {
            if (value == null)
            {
                string message = name == null ? $"Value cannot be null" : "Name cannot be null";

                throw new NullReferenceException();
            }
        }
        public static void ValidateMin(int value, int minimum , string typeName , string properyName)
        {
            if(value < minimum)
            {
                throw new ArgumentOutOfRangeException($"{typeName}.{properyName} cannot be less than minimum");
            }
        }

        public static void ValidateMin(decimal value, int minimum, string typeName,  string properyName)
        {
            if (value < minimum)
            {
                throw new ArgumentOutOfRangeException($"{typeName}.{properyName} cannot be less than minimum");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Text;

namespace StringBuilder_try
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder(1000);
            for (int i = 0; i < 10 ; i++)
            {
                sb.Append("Softuni");
            }
            sb.Clear(); 
            Console.WriteLine(sb);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Stack_of_Strings
{
    public static class CollectionExtensions
    {
        public static bool IsEmpty<T>(this ICollection<T> collection)
        {
            return collection.Count == 0;
        }
        
        public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> values)
        {
            foreach (var value in values)
            {
                collection.Add(value);
            }
        }
    }
}
<file_sep>﻿using System;

namespace ChristmasTournament
{
    class Program
    {
        static void Main(string[] args)
        {
            int days = int.Parse(Console.ReadLine());
            
            double moneyRaisedThisDay = 0;
            double allMoney = 0;
          
            int countWinDay = 0;

            
            int countLostDay = 0;
            for (int i = 0; i < days; i++)
            {  
                int countWins = 0;
                int countLosses = 0;
                moneyRaisedThisDay = 0;

                string command = Console.ReadLine();
                while (command != "Finish")
                {
                    string result = Console.ReadLine();
                    if (result == "win")
                    {
                        moneyRaisedThisDay += 20;
                        countWins++;
                    }
                    else
                    {
                        countLosses++;
                    }

                    command = Console.ReadLine();
                }
                if (countWins > countLosses)
                {
                    moneyRaisedThisDay += moneyRaisedThisDay * 0.1;
                    allMoney += moneyRaisedThisDay;
                    countWinDay++;
                }
                else
                {
                    allMoney += moneyRaisedThisDay;
                    countLostDay++;
                }
            }
            if(countWinDay > countLostDay)
            {
                allMoney += allMoney * 0.2;
                Console.WriteLine($"You won the tournament! Total raised money: {allMoney:F2}");
            }
            else
            {
                Console.WriteLine($"You lost the tournament! Total raised money: {allMoney:F2}");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04.NeedForSpeed.Motorcycles
{
    public class RaceMotorcycle : Motorcycle
    {
        private const double defaultFuelConsumption = 8;

        public RaceMotorcycle(int horsePower, double fuel) : base(horsePower, fuel)
        {
        }

        public override double FuelConsumption => defaultFuelConsumption;
        //{
        //    get 
        //    { 
        //        return this.FuelConsumption;
        //    }
        //    set
        //    {
        //        this.FuelConsumption = defaultFuelConsumption;
        //    }
        //}

        public override void Drive(double kilometers)
        {
            double fuelAfterDrive = this.Fuel - kilometers * this.FuelConsumption;
            if (fuelAfterDrive >= 0)
            {
                this.Fuel -= kilometers * this.FuelConsumption;
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CounterStrike.Models.Guns
{
    public class Pistol : Gun
    {
        private const int pistolFireBulletsCount = 1;
        public Pistol(string name, int bulletsCount)
            : base(name, bulletsCount)
        {
        }

        public override int Fire()
        {
            return pistolFireBulletsCount;
        }
    }
}
<file_sep>﻿using System;

namespace Special_Number
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            bool isSpecial = true;
            for(int i=1111;i<9999;i++)
            {
                isSpecial = true;
                string command = i.ToString();
                for(int j=0;j<command.Length;j++)
                {
                    int num = int.Parse(command[j].ToString());
                    if (num == 0)
                    {
                        isSpecial = false;
                        continue;
                    }
                    if (n%num!=0)
                    {
                       isSpecial = false;
                       break;
                    }
                }
                if(isSpecial)
                {
                    Console.Write($"{i} ");
                }
               

            }
        }
    }
}
<file_sep>﻿using System;

namespace Hotel_Reservation
{
    class Program
    {
        static void Main(string[] args)
        {
            var calculator = new PriceCalculator();

            calculator.Calculate(10.5, Season.Spring);
        }
    }
}
<file_sep>﻿using System;

namespace _04.Food_for_Pets
{
    class Program
    {
        static void Main(string[] args)
        {
            int countDays = int.Parse(Console.ReadLine());
            double allFood = double.Parse(Console.ReadLine());

         //   double eatenFoodADay = 0;
            double eatenByDog = 0;
            double eatenByCat = 0;
            double sumDog = 0;
           double sumCat = 0;
            double sumEaten = 0;
            double biscuits = 0;
            for(int i=1;i<=countDays;i++)
            {
                eatenByDog = double.Parse(Console.ReadLine());
                sumDog += eatenByDog;
                eatenByCat = double.Parse(Console.ReadLine());
                sumCat += eatenByCat;
               
                //eatenFoodADay = eatenByDog + eatenByCat;
                sumEaten += eatenByCat + eatenByDog;
                if(i%3==0)
                {
                    biscuits += (eatenByDog + eatenByCat) * 0.1;
                }

            }
           
            Console.WriteLine($"Total eaten biscuits: {Math.Round(biscuits)}gr.");
            Console.WriteLine($"{sumEaten*100 / allFood:F2}% of the food has been eaten.");
            Console.WriteLine($"{sumDog*100/sumEaten:F2}% eaten from the dog.");
            Console.WriteLine($"{sumCat*100/sumEaten:F2}% eaten from the cat.");

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _01._Activation_Keys
{
    class Program
    {
        static void Main(string[] args)
        {
            string activationKey = Console.ReadLine();

            string input;
            while((input = Console.ReadLine()) != "Generate")
            {
                string[] command = input.Split(">>>").ToArray();
                if(command[0] == "Contains")
                {
                    string substr = command[1];
                    if (activationKey.Contains(substr))
                    {
                        Console.WriteLine($"{activationKey} contains {substr}");
                    }
                    else
                    {
                        Console.WriteLine("Substring not found!");
                    }
                }
                else if(command[0] == "Flip")
                {
                    if(command[1] == "Upper")
                    {
                        int startIndex = int.Parse(command[2]);
                        int endIndex = int.Parse(command[3]);
                        string oldString = activationKey.Substring(startIndex, endIndex - startIndex);
                        string newString = oldString.ToUpper();

                        activationKey = activationKey.Replace(oldString, newString);
                    }
                    else
                    {
                        int startIndex = int.Parse(command[2]);
                        int endIndex = int.Parse(command[3]);

                        string oldString = activationKey.Substring(startIndex, endIndex - startIndex);
                        string newString = oldString.ToLower();

                        activationKey = activationKey.Replace(oldString, newString);
                    }
                    Console.WriteLine(activationKey);

                }
                else
                {
                    int startIndex = int.Parse(command[1]);
                    int endIndex = int.Parse(command[2]);
                    string oldString = activationKey.Substring(startIndex, endIndex - startIndex);

                    activationKey = activationKey.Replace(oldString, "");

                    Console.WriteLine(activationKey);
                }

            }

            Console.WriteLine($"Your activation key is: {activationKey}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace _02._Mirror_Words
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = Console.ReadLine();
            //string hiddenPattern = @"((#|@)(?<word1>[A-Za-z]{3,})(\2))((\2)(?<word2>[A-Za-z]{3,})(\4))";
            string hiddenPattern = @"(@|#)(?<first>[A-Za-z]{3,})\1\1(?<second>[A-Za-z]{3,})\1";

            List<string> mirrorWords = new List<string>();
            var matches = Regex.Matches(text, hiddenPattern);
            if(matches.Count == 0)
            {
                Console.WriteLine("No word pairs found!");
            }
            else
            {
                Console.WriteLine($"{matches.Count} word pairs found!");
                //Dictionary<string, string> mirrorWords = new Dictionary<string, string>();
                

                foreach (Match match in matches)
                {
                    string str1 = match.Groups["first"].Value;
                    string str2 = match.Groups["second"].Value;

                    char[] str2Arr = str2.ToCharArray();
                    Array.Reverse(str2Arr);
                    string str2InStringReversed = new string(str2Arr);

                    if(str1 == str2InStringReversed)
                    {
                        string mirrorWord = str1 + " <=> " + str2;
                        mirrorWords.Add(mirrorWord);
                    }
                }
                
            }

            if (mirrorWords.Count != 0)
            {
                Console.WriteLine("The mirror words are:");
                Console.WriteLine(String.Join(", ", mirrorWords));
            }
            else
            {
                Console.WriteLine("No mirror words!");
            }

        }
    }
}
<file_sep>﻿using System;

namespace Class_Enum
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = { 1, 2, 3, 4 ,6};
            Console.WriteLine(arr.Length);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _08.Vehicle_Catalogue
{
    class Truck
    {
        public string Brand { get; set; }
        public string Model { get; set; }
        public int Weight { get; set; }

    }
    class Car
    {
        public string Brand { get; set; }
        public string Model { get; set; }

        public int HorsePower { get; set; }
    }
    class CatalogVehicle
    {
        public CatalogVehicle()
        {
            Cars = new List<Car>();
            Trucks = new List<Truck>();
        }

        public List<Car> Cars { get; set; }
        public List<Truck> Trucks { get; set; }

    }
    class Program
    {
        static void Main(string[] args)
        {
            CatalogVehicle catalog = new CatalogVehicle();

            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end")
                {
                    break;
                }
                string[] info = input.Split("/");
                string brand = info[1];
                string model = info[2];
                int HorsePowerOrWeight = int.Parse(info[3]);
                
                if(info[0] == "Car")
                {
                    Car car = new Car();
                    
                    car.Brand = brand;
                    car.Model = model;
                    car.HorsePower = HorsePowerOrWeight;

                    catalog.Cars.Add(car);                   
                }
                else
                {
                    Truck truck = new Truck();
                    truck.Brand = brand;
                    truck.Model = model;
                    truck.Weight = HorsePowerOrWeight;

                    catalog.Trucks.Add(truck);
                }
            }
            if (catalog.Cars.Count > 0)
            {
                Console.WriteLine("Cars:");
                foreach (Car car in catalog.Cars.OrderBy(x => x.Brand))
                {

                    Console.WriteLine($"{car.Brand}: {car.Model} - {car.HorsePower}hp");
                }
            }
            if (catalog.Trucks.Count > 0)
            {

                Console.WriteLine("Trucks:");
                foreach (Truck truck in catalog.Trucks.OrderBy(x => x.Brand))
                {
                    Console.WriteLine($"{truck.Brand}: {truck.Model} - {truck.Weight}kg");
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P07.MilitaryElite.Exceptions
{
    public class InvalidCorpsException : Exception
    {
        private const string DEF_MESS = "Ivalid corps";
        public InvalidCorpsException()
            :base(DEF_MESS)
        {
        }

        public InvalidCorpsException(string message)
            : base(message)
        {
        }

       // public static string 
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P06.FoodShortage
{
    public interface IBirthable
    {
        string GetBirth();
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;

namespace _10._Predicate_Party_
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> names = Console.ReadLine()
                .Split()
                .ToList();

            

            string command;
            while((command = Console.ReadLine()) != "Party!")
            {
                string[] cmdArgs = command.Split();

                string cmdType = cmdArgs[0];
                string[] predicateArgs = cmdArgs
                    .Skip(1)
                    .ToArray();

                Predicate<string> predicate = GetPredicate(predicateArgs);

                if(cmdType == "Remove")
                {
                    names.RemoveAll(predicate);
                }
                else if(cmdType == "Double")
                {
                    DoubleNames(names, predicate);
                }

            }

            if(names.Count == 0)
            {
                Console.WriteLine("Nobody is going to the party!");
            }
            else
            {
                Console.WriteLine($"{string.Join(", ",names)} are going to the party!");
            }
        }

        private static void DoubleNames(List<string> names, Predicate<string> predicate)
        {
            for (int i = 0; i < names.Count; i++)
            {
                string currName = names[i];

                if (predicate(currName))
                {
                    names.Insert(i + 1, currName);
                    i++;
                }
            }
        }

        static Predicate<string> GetPredicate(string[] predicateArgs)
        {
            string prType = predicateArgs[0];
            string prArg = predicateArgs[1];

            Predicate<string> predicate = null;

            if (prType == "StartsWith")
            {
                predicate = new Predicate<string>((name) =>
                {
                    return name.StartsWith(prArg);
                });
            }
            else if(prType == "EndsWith")
            {
                predicate = new Predicate<string>((name) =>
                {
                    return name.EndsWith(prArg);
                });
            }
            else if(prType == "Length")
            {
                predicate = new Predicate<string>((name) =>
                {
                    return name.Length == int.Parse(prArg);
                });
            }

            return predicate;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _01._Flower_Wreaths
{
    class Program
    {
        static void Main(string[] args)
        {
            Stack<int> lilies = new Stack<int>(Console.ReadLine().Split(", ").Select(int.Parse).ToArray());
            Queue<int> roses = new Queue<int>(Console.ReadLine().Split(", ").Select(int.Parse).ToArray());

            int count_wraiths = 0;
            int stored_flowers = 0;
            while(lilies.Any() && roses.Any())
            {
                int sum = lilies.Peek() + roses.Peek();
                if(sum == 15)
                {
                    count_wraiths++;
                    lilies.Pop();
                    roses.Dequeue();
                }
                else if(sum > 15)
                {
                    int to_push = lilies.Pop() - 2;
                    lilies.Push(to_push);
                }
                else if(sum < 15)
                {
                    lilies.Pop();
                    roses.Dequeue();
                    stored_flowers += sum;
                }
            }
            while(stored_flowers > 0)
            {
                if(stored_flowers - 15 >= 0)
                {
                    count_wraiths++;
                    stored_flowers -= 15;
                }
                else
                {
                    break;
                }
            }

            if(count_wraiths >= 5)
            {
                Console.WriteLine($"You made it, you are going to the competition with {count_wraiths} wreaths!");
            }
            else
            {
                Console.WriteLine($"You didn't make it, you need {5-count_wraiths} wreaths more!");
            }
        }
    }
}
<file_sep>﻿using P01.Vehicles.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace P01.Vehicles.Models
{
    public class Truck : Vehicle
    {
        private const double FUEL_CONS_INCREMENT = 1.6;
        private const double REFUEL_EFIICIENCY_PERCENTSGE = 0.95;

        public Truck(double fuelquantity, double fuelconsumption, double tankCapacity)
            : base(fuelquantity, fuelconsumption, tankCapacity)
        {
        }

        public override double FuelConsumption
        {
            get
            {
                return base.FuelConsumption;
            }
            protected set
            {
                base.FuelConsumption = value + FUEL_CONS_INCREMENT;
            }

        }

        public override void Refuel(double liters)
        {
            double litersIn = liters * REFUEL_EFIICIENCY_PERCENTSGE;
            if(liters > 0)
            {
                if (this.FuelQuantity + litersIn > this.TankCapacity)
                {
                    string exc = string.Format(ExceptionMessage
                        .InvalidFuelTankExceptionMessage, liters);
                    throw new InvalidOperationException(exc);
                }
                this.FuelQuantity += litersIn;
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessage.FuelIsNegativeOrZero);
            }
        }

    }
}
<file_sep>﻿using System;

namespace SupppliesForSchool
{
    class Program
    {
        static void Main(string[] args)
        {
            int countPen = int.Parse(Console.ReadLine());
            int countMarkers = int.Parse(Console.ReadLine());
            double litre = double.Parse(Console.ReadLine());
            int countSale = int.Parse(Console.ReadLine());

            double neededMoney = countPen * 5.80 + countMarkers * 7.20 + litre * 1.20;
            neededMoney = neededMoney - ((neededMoney * countSale) / 100);
            Console.WriteLine($"{neededMoney:F3}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Hotel_Reservation
{
    class PriceCalculator
    {
        public decimal Calculate(decimal pricePerDay, int days ,Season season,Discount discount = Discount.None)
        {
            var price = days * pricePerDay * (int)season;

            price -= (int)discount * price/100;

            return price;
        }
    }
}
<file_sep>﻿using System;
using System.Linq;
using System.Text;

namespace P02.BookWorm
{
    class Program
    {
        static void Main(string[] args)
        {
            string receivedString = Console.ReadLine();
            StringBuilder initialString = new StringBuilder();
            initialString.Append(receivedString);

            int N = int.Parse(Console.ReadLine());
            char[,] field = new char[N, N];
            InitField(N, field);

            int playerRow = -1;
            int playerCol = -1;

            //Finding player's row and col
            FindPlayerRowCol(N, field, ref playerRow, ref playerCol);

            string command;
            while ((command = Console.ReadLine()) != "end")
            {
                if (command == "up")
                {
                    if (playerRow - 1 < 0)
                    {
                        initialString.Remove(initialString.Length - 1, 1);
                    }
                    else
                    {
                        field[playerRow, playerCol] = '-';
                        char currChar = field[playerRow - 1, playerCol];
                        if (char.IsLetter(currChar))
                        {
                            initialString.Append(currChar);
                        }
                        field[playerRow - 1, playerCol] = 'P';

                        playerRow -= 1;
                    }
                }
                else if (command == "down")
                {
                    if (playerRow + 1 == N)
                    {
                        initialString.Remove(initialString.Length - 1, 1);
                    }
                    else
                    {
                        field[playerRow, playerCol] = '-';
                        char currChar = field[playerRow + 1, playerCol];
                        if (char.IsLetter(currChar))
                        {
                            initialString.Append(currChar);
                        }
                        field[playerRow + 1, playerCol] = 'P';

                        playerRow += 1;
                    }
                }
                else if (command == "left")
                {
                    if (playerCol - 1 < 0)
                    {
                        initialString.Remove(initialString.Length - 1, 1);
                    }
                    else
                    {
                        field[playerRow, playerCol] = '-';
                        char currChar = field[playerRow, playerCol - 1];
                        if (char.IsLetter(currChar))
                        {
                            initialString.Append(currChar);
                        }
                        field[playerRow, playerCol - 1] = 'P';

                        playerCol -= 1;
                    }
                }
                else if (command == "right")
                {
                    if (playerCol + 1 == N)
                    {
                        initialString.Remove(initialString.Length - 1, 1);
                    }
                    else
                    {
                        field[playerRow, playerCol] = '-';
                        char currChar = field[playerRow, playerCol + 1];
                        if (char.IsLetter(currChar))
                        {
                            initialString.Append(currChar);
                        }
                        field[playerRow, playerCol + 1] = 'P';

                        playerCol += 1;

                    }
                }
            }

            Console.WriteLine(initialString);
            PrintMatrix(N, field);

        }

        private static void PrintMatrix(int N, char[,] field)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    Console.Write($"{field[row, col]}");
                }
                Console.WriteLine();
            }
        }

        private static void FindPlayerRowCol(int N, char[,] field, ref int playerRow, ref int playerCol)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    if (field[row, col] == 'P')
                    {
                        playerRow = row;
                        playerCol = col;
                    }
                }
            }
        }

        private static void InitField(int N, char[,] field)
        {
            for (int row = 0; row < N; row++)
            {
                string currRow = Console.ReadLine();
                for (int col = 0; col < N; col++)
                {
                    field[row, col] = currRow[col];
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace P01.GenericBoxofString
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<double> elements = new List<double>();

            for (int i = 0; i < n; i++)
            {
                double element = double.Parse(Console.ReadLine());
                elements.Add(element);

                //Box<int> box = new Box<int>(value);
                //Console.WriteLine(box);
            }
            Box<double> box = new Box<double>(elements);

            double elementToCompare = double.Parse(Console.ReadLine());

            Console.WriteLine(box.CountGreaterElements(elements,elementToCompare));


            //int[] indexesToSwap = Console.ReadLine()
            //    .Split()
            //    .Select(int.Parse)
            //    .ToArray();

            //box.SwapElementsByIndex(elements, indexesToSwap[0], indexesToSwap[1]);
            //Console.WriteLine(box);
        }
    }
}
<file_sep>﻿using System;

namespace _09._Palindrome_Integers
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string command = Console.ReadLine();
                if(command == "END")
                {
                    break;
                }
                int num = int.Parse(command);
                IsPalindrome(num);

            }
        }
        static void IsPalindrome(int n)
        {
            string str = n.ToString();
            string res = "";
            int len = str.Length - 1;
            while(len >= 0)
            {
                res += str[len];
                len--;
            }
            if(str == res)
            {
                Console.WriteLine("true");
            }
            else
            {
                Console.WriteLine("false");
            }
        }
    }
}
<file_sep>﻿using System;

namespace _05.LoadSuitcases
{
    class Program
    {
        static void Main(string[] args)
        {
            double capacity = double.Parse(Console.ReadLine());
            string command = Console.ReadLine();
            int countluggage = 0;
            bool noSpace = false;

            while(command != "End")
            {
               double capSuitcase = double.Parse(command);
               if((countluggage+1)%3==0)
                {
                    capSuitcase = capSuitcase + capSuitcase * 0.1;
                }
               if(capacity<capSuitcase)
                {
                    noSpace = true;
                    break;
                }
               capacity = capacity - capSuitcase;
               countluggage++;
               command = Console.ReadLine();
            }

            if(command=="End")
            {
                Console.WriteLine("Congratulations! All suitcases are loaded!");
            }
            if(noSpace == true)
            {
                Console.WriteLine("No more space!");
            }
            Console.WriteLine($"Statistic: {countluggage} suitcases loaded.");
           // Console.WriteLine(capacity);

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;

namespace P05.ComparingObjects
{
    public class Person : IComparable<Person>
    {
        public Person(string name,int age , string town)
        {
            this.Name = name;
            this.Age = age;
            this.Town = town;
        }
        public string Name { get; set; }
        public int Age { get; set; }
        public string Town { get; set; }

        public int CompareTo([AllowNull] Person person)
        {
            int result = 1;
            if(person != null)
            {
                result = this.Name.CompareTo(person.Name);
                if(result == 0)
                {
                    result = this.Age.CompareTo(person.Age);
                    if(result == 0)
                    {
                        result = this.Town.CompareTo(this.Town);
                    }
                }

            }
            return result;

        }
    }
}
<file_sep>﻿using System;

namespace Concatanate
{
    class Program
    {
        static void Main(string[] args)
        {
            string firstname = Console.ReadLine();
            string lastname = Console.ReadLine();
            int age = int.Parse(Console.ReadLine());
            string grad = Console.ReadLine();

            // Console.WriteLine("You are"+ firstname +lastname, a -years old person from <town>.");
            Console.WriteLine($"You are {firstname} {lastname}, a {age}-years old person from {grad}.");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public class CatOnJet : Vehicle
    {
        public string Name { get; set; }

        public override string VrumVrum()
        {
            return "Cat is meowing";
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _08._Balanced_Parenthesis
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            Stack<char> parenthessStack = new Stack<char>();
            foreach (var symbol in input)
            {
                if (parenthessStack.Any())
                {
                    char check = parenthessStack.Peek();
                    if(check == '{' && symbol == '}')
                    {
                        parenthessStack.Pop();
                        continue;
                    }
                    else if(check == '[' && symbol == ']')
                    {
                        parenthessStack.Pop();
                        continue;
                    }
                    else if(check == '(' && symbol == ')')
                    {
                        parenthessStack.Pop();
                        continue;
                    }

                }

                parenthessStack.Push(symbol);
            }

            Console.WriteLine(parenthessStack.Any() ? "NO" : "YES");
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace P03.Stack
{
    public class Stack<T> : IEnumerable<T>
    {
        private readonly List<T> data;
        
        public Stack()
        {
            this.data = new List<T>();
        }

        public void Push(IEnumerable<T> elements)
        {
            foreach (var element in elements)
            {
                this.Push(element);
            }
        }
        public void Push(T element)
        {
            this.data.Add(element);
        }
        public T Pop()
        {
            if(this.data.Count == 0)
            {
                throw new InvalidOperationException("No elements");
            }
            
            T removedElement =  this.data[this.data.Count - 1];
            this.data.RemoveAt(this.data.Count - 1);
            return removedElement;
        }

        public IEnumerator<T> GetEnumerator()
        {
            for(int i = this.data.Count - 1;i >= 0; i--)
            {
                yield return this.data[i];
            }
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}
<file_sep>﻿using System;

namespace _01._Bonus_Scoring_System
{
    class Program
    {
        static void Main(string[] args)
        {
            int countStudents = int.Parse(Console.ReadLine());
            int countLectures = int.Parse(Console.ReadLine());
            int initialBonus = int.Parse(Console.ReadLine());

            double maxBonus = 0;
            int maxAttend = 0;
            for (int i = 0; i < countStudents; i++)
            {
                int currAttendance = int.Parse(Console.ReadLine());
                double currBonus = ((1.0*currAttendance / countLectures)) * (5 + initialBonus);

                if(currBonus > maxBonus)
                {
                    maxBonus = currBonus;
                    maxAttend = currAttendance;
                }

            }
            Console.WriteLine($"Max Bonus: {Math.Ceiling(maxBonus)}.");
            Console.WriteLine($"The student has attended {maxAttend} lectures.");
        }
    }
}
<file_sep>﻿using System;

namespace TrekkingMania
{
    class Program
    {
        static void Main(string[] args)
        {
            double countMus = 0;
            double countMon = 0;
            double countKili = 0;
            double countK2 = 0;
            double countEver = 0;
            double peopleCount = 0;
            int groups = int.Parse(Console.ReadLine());
            for(int i=0;i<groups;i++)
            {
                
                int people = int.Parse(Console.ReadLine());
                peopleCount += people;
                if (people <= 5)
                {
                    countMus += people;
                }
                else if (people >= 6 && people <= 12)
                {
                    countMon += people;
                }
                else if (people >= 13 && people <= 25)
                {
                    countKili += people;
                }
                else if (people >= 26 && people <= 40)
                {
                    countK2 += people;
                }
                else if(people>=41)
                {
                    countEver += people;
                }
            }
            Console.WriteLine($"{countMus/peopleCount*100:F2}%");
            Console.WriteLine($"{countMon / peopleCount * 100:F2}%");
            Console.WriteLine($"{countKili / peopleCount * 100:F2}%");
            Console.WriteLine($"{countK2 / peopleCount * 100:F2}%");
            Console.WriteLine($"{countEver / peopleCount * 100:F2}%");



        }
    }
}
<file_sep>﻿using System;

namespace MultiplicationTable
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i=1;i<=10;i++)
            {
                for(int j=1;j<=10;j++)
                {
                    Console.WriteLine($"{i} * {j} = {i*j}");
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace _01._Computer_Store
{
    class Program
    {
        static void Main(string[] args)
        {
            double totalPrice = 0;
            double totalTaxes = 0;
            string input;
            while((input = Console.ReadLine()) != "special" && input != "regular")
            {
                double currPrice = double.Parse(input);
                if (currPrice < 0)
                {
                    Console.WriteLine("Invalid price!");
                }
                else
                {
                     totalTaxes += currPrice * 0.2;
                    //currPrice += currPrice * 0.2;

                     totalPrice += currPrice;
                }
            }
            double totalPriceWithDisc = totalPrice + totalTaxes;
            if(input == "special")
            {
                totalPriceWithDisc -= (totalPrice + totalTaxes) * 0.1;
            }
            
            
            if(totalPrice == 0)
            {
                Console.WriteLine("Invalid order!");
            }
            else
            {
                Console.WriteLine($"Congratulations you've just bought a new computer!\n" +
                    $"Price without taxes: {totalPrice:F2}$\n" +
                    $"Taxes: {totalTaxes:F2}$\n" +
                    $"-----------\n" +
                    $"Total price: {totalPriceWithDisc:F2}$");
            }
        }
    }
}
<file_sep>﻿using System;

namespace _10._Radioactive_Mutant_Vampire_Bunnies
{
    class Program
    {
        static void Main(string[] args)
        {
            
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _06._Vehicle_Catalogue
{
   
    class Program
    {
        static void Main(string[] args)
        {
            List<Vehicle> catalogue = new List<Vehicle>();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "End")
                {
                    break;
                }
                string[] command = input.Split();
                string type = command[0];
                string model = command[1];
                string color = command[2];
                int horsePower = int.Parse(command[3]);

                Vehicle vehicle = new Vehicle(type, model, color, horsePower);
                catalogue.Add(vehicle);

            }

            while (true)
            {
                string input = Console.ReadLine();
                if(input == "Close the Catalogue")
                {
                    break;
                }
                Vehicle vehicleWithThatModel = catalogue.Find(v => v.Model == input);

                Console.WriteLine(vehicleWithThatModel.ToString());
                
            }
            List<Vehicle> onlyCars = catalogue.Where(x => x.Type == "car").ToList();
            List<Vehicle> onlyTrucks = catalogue.Where(x => x.Type == "truck").ToList();

            double sumCarsHorse = 0;
            double sumTrucksHorse = 0;

            foreach (Vehicle car in onlyCars)
            {
                sumCarsHorse += car.HorsePower;
            }
            foreach (Vehicle truck in onlyTrucks)
            {
                sumTrucksHorse += truck.HorsePower;
            }

            double averageCars = sumCarsHorse / onlyCars.Count;
            double averageTrucks = sumTrucksHorse / onlyTrucks.Count;

          //  Console.WriteLine($"Cars have average horsepower of: {Math.Round(averageCars,2):F2}.");
          //  Console.WriteLine($"Trucks have average horsepower of: {Math.Round(averageTrucks, 2):F2}.");
            if (onlyCars.Count > 0)
            {
                Console.WriteLine($"Cars have average horsepower of: {Math.Round(averageCars, 2):F2}.");


            }
            else
            {
                Console.WriteLine($"Cars have average horsepower of: {0:f2}.");
            }

            if (onlyTrucks.Count > 0)
            {
                Console.WriteLine($"Trucks have average horsepower of: {Math.Round(averageTrucks, 2):F2}.");
            }
            else
            {
                Console.WriteLine($"Trucks have average horsepower of: {0:f2}.");
            }

        }
    }
    class Vehicle
    {
        public Vehicle(string type,string model,string color,int horsePower)
        {
            this.Type = type;
            this.Model = model;
            this.Color = color;
            this.HorsePower = horsePower;
        }
        public string Type { get; set; }
        public string Model { get; set; }
        public string Color { get; set; }
        public int HorsePower { get; set; }

        public override string ToString()
        {
            if (this.Type == "car")
            {
                return $"Type: Car\n" +
                $"Model: {this.Model}\n" +
                $"Color: {this.Color}\n" +
                $"Horsepower: {this.HorsePower}\n".Trim();
            }
            else
            {
                return $"Type: Truck\n" +
                $"Model: {this.Model}\n" +
                $"Color: {this.Color}\n" +
                $"Horsepower: {this.HorsePower}\n".Trim();
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P05.DateModifier
{
    public class DateModifier
    {
        public int CalculateDifference(string data1,string data2)
        {
            var date1Arr = data1.Split()
                .Select(int.Parse)
                .ToArray();

            DateTime dateTime1 = new DateTime(date1Arr[0], date1Arr[1], date1Arr[2]);

            var date2Arr = data2.Split()
                .Select(int.Parse)
                .ToArray();

            DateTime dateTime2 = new DateTime(date2Arr[0], date2Arr[1], date2Arr[2]);

            return Math.Abs((dateTime1 - dateTime2).Days);

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace _04.Songs
{
    class Song
    {
        ///Type list // Name // Duration
        public string TypeList { get; set; }
        public string Name { get; set; }

        public string Time { get; set; }
    }
    class Program
    {
        static void Main(string[] args)
        {
            ///
            //3
            //favourite_DownTown_3: 14
            //favourite_Kiss_4: 16
            //favourite_Smooth Criminal_4:01
            //favourite

            int n = int.Parse(Console.ReadLine());

            List<Song> songs = new List<Song>();

            for (int i = 0; i < n; i++)
            {
                string[] input = Console.ReadLine()
                    .Split('_');

                string typeList = input[0];
                string name = input[1];
                string time = input[2];

                Song song = new Song();
                song.TypeList = typeList;
                song.Name = name;
                song.Time = time;

                songs.Add(song);
            }

            string targetListType = Console.ReadLine();
            if (targetListType == "all")
            {
                for (int i = 0; i < songs.Count; i++)
                {
                    Console.WriteLine(songs[i].Name);
                }
            }
            else
            {
                for (int i = 0; i < songs.Count; i++)
                {
                    if (songs[i].TypeList == targetListType)
                    {
                        Console.WriteLine(songs[i].Name);
                    }
                }
                ///2nd example
                //songs = songs.FindAll(x => x.TypeList == targetListType);
                //foreach (var currSong in songs)
                //{
                //    Console.WriteLine(currSong.Name);
                //}
            }

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _8._Bombs
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int[,] matrix = new int[N, N];
            InicialisingMatrix(N, matrix);

            string[] bombInfo = Console.ReadLine().Split().ToArray();

            for (int i = 0; i < bombInfo.Length; i++)
            {
                int[] bombArgs = bombInfo[i]
                    .Split(',', StringSplitOptions.RemoveEmptyEntries)
                    .Select(int.Parse)
                    .ToArray();

                int row = bombArgs[0];
                int col = bombArgs[1];
                if (matrix[row, col] <= 0)
                {
                    continue;
                }
                int damage = matrix[row, col];
                matrix[row, col] = 0;
                if (row - 1 >= 0)
                {
                    if (IsAlive(matrix, row - 1, col))
                    {
                        matrix[row - 1, col] -= damage;
                    }
                }
                if (row + 1 < N)
                {
                    if (IsAlive(matrix, row + 1, col))
                    {
                        matrix[row + 1, col] -= damage;
                    }

                }
                if (col - 1 >= 0)
                {
                    if (IsAlive(matrix, row, col - 1))
                    {
                        matrix[row, col - 1] -= damage;
                    }
                }
                if (col + 1 < N)
                {
                    if (IsAlive(matrix, row, col + 1))
                    {
                        matrix[row, col + 1] -= damage;
                    }

                }
                if (col - 1 >= 0 && row - 1 >= 0)
                {
                    if (IsAlive(matrix, row - 1, col - 1))
                    {
                        matrix[row - 1, col - 1] -= damage;
                    }

                }
                if (col + 1 < N && row - 1 >= 0)
                {
                    if (IsAlive(matrix, row - 1, col + 1))
                    {
                        matrix[row - 1, col + 1] -= damage;
                    }

                }
                if (row + 1 < N && col - 1 >= 0)
                {
                    if (IsAlive(matrix, row + 1, col - 1))
                    {
                        matrix[row + 1, col - 1] -= damage;
                    }

                }
                if (row + 1 < N && col + 1 < N)
                {
                    if (IsAlive(matrix, row + 1, col + 1))
                    {
                        matrix[row + 1, col + 1] -= damage;
                    }

                }


            }
            int aliveCells = 0;
            int sumOfAliveCells = 0;

            aliveCells = FindingAliveCells(N, matrix, aliveCells);
            sumOfAliveCells = FindingSumOfAliveCells(N, matrix, sumOfAliveCells);

            Console.WriteLine($"Alive cells: {aliveCells}");
            Console.WriteLine($"Sum: {sumOfAliveCells}");

            PrintMatrix(N, matrix);

        }

        private static int FindingSumOfAliveCells(int N, int[,] matrix, int sumOfAliveCells)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    if (IsAlive(matrix, row, col))
                    {
                        sumOfAliveCells += matrix[row, col];
                    }
                }
            }

            return sumOfAliveCells;
        }

        private static int FindingAliveCells(int N, int[,] matrix, int aliveCells)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    if (IsAlive(matrix, row, col))
                    {
                        aliveCells++;
                    }
                }
            }

            return aliveCells;
        }

        private static bool IsAlive(int [,] matrix , int row , int col)
        {
            if(matrix[row,col] > 0)
            {
                return true;
            }
            return false;
        }

        private static void PrintMatrix(int N, int[,] matrix)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    Console.Write(matrix[row, col] + " ");
                }
                Console.WriteLine();
            }
        }

        private static void InicialisingMatrix(int N, int[,] matrix)
        {
            for (int row = 0; row < N; row++)
            {
                int[] currRow = Console.ReadLine()
                    .Split(' ',StringSplitOptions.RemoveEmptyEntries)
                    .Select(int.Parse)
                    .ToArray();
                for (int col = 0; col < N; col++)
                {
                    matrix[row, col] = currRow[col];
                }
            }
        }

    }
}
<file_sep>﻿using FightingArena;
using NUnit.Framework;
using System;

namespace Tests
{
    public class ArenaTests
    {
        private Arena arena;
        private Warrior w1;
        private Warrior attacker;
        private Warrior defender;
        [SetUp]
        public void Setup()
        {
            arena = new Arena();
            w1 = new Warrior("Vlado",5,50);

            attacker = new Warrior("Pesho", 10, 80);
            defender = new Warrior("Gosho", 5, 60);

        }

        [Test]
        public void TestIfConstructorWorksCorrectly()
        {
            Assert.IsNotNull(this.arena.Warriors);
        }
        [Test]
        public void EnrollShouldAddTheWarriorToTheArenaAndIncreaseCount()
        {
            arena.Enroll(w1);

            Assert.That(this.arena.Warriors, Has.Member(w1));
            Assert.AreEqual(1, arena.Warriors.Count);
        }
        [Test]
        public void EnrollingSameWarriorShouldThrowException()
        {
            arena.Enroll(w1);

            Assert.Throws<InvalidOperationException>(() =>
            {
                arena.Enroll(w1);
            });
        }
        [Test]
        public void EnrollingSameWarriorShouldThrowException2()
        {
            arena.Enroll(w1);
            Warrior w1Copy = new Warrior(w1.Name, w1.Damage, w1.HP);

            Assert.Throws<InvalidOperationException>(() =>
            {
                arena.Enroll(w1Copy);
            });
        }
        [Test]
        public void TestFightingWithMissingAttacker()
        {
            arena.Enroll(defender);

            Assert.Throws<InvalidOperationException>(() =>
            {
                arena.Fight(attacker.Name, defender.Name);
            });
        }
        [Test]
        public void TestFightingWithMissingDefender()
        {
            arena.Enroll(attacker);

            Assert.Throws<InvalidOperationException>(() =>
            {
                arena.Fight(attacker.Name, defender.Name);
            });
        }
        [Test]
        public void TestFightingBetweenTwoWarrioirs()
        {
            int expectedAHP = attacker.HP - defender.Damage;
            int expectedDHP = defender.HP - attacker.Damage;


            arena.Enroll(attacker);
            arena.Enroll(defender);

            arena.Fight(attacker.Name, defender.Name);


            Assert.AreEqual(expectedAHP, attacker.HP);
            Assert.AreEqual(defender.HP, defender.HP);


        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Stack_of_Strings
{
    class StackOfStrings:Stack<string>
    {
        public bool IsEmpty()
        {
            return this.Count == 0;
        }

        public void AddRange(IEnumerable<string> values)
        {
            foreach (var value in values)
            {
                this.Push(value);
            }
        }
    }
}
<file_sep>﻿using System;
using System.IO.Compression;

namespace _06.ZipAndExtract
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                ZipFile.CreateFromDirectory(".","myArchive.zip");
                // ZipFile.ExtractToDirectory() 
            }
            catch (Exception)
            {
                throw;
            }


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _05._Fashion_Boutique
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] clothes = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            Stack<int> stack = new Stack<int>(clothes);

            int rackCapacity = int.Parse(Console.ReadLine());

            int racksCount = 1;
            int sumOfClothes = 0;

            while (stack.Any())
            {
                sumOfClothes += stack.Peek();           
                if(sumOfClothes < rackCapacity)
                {
                    stack.Pop();
                }
                else if(sumOfClothes == rackCapacity)
                {
                    //racksCount++;
                    stack.Pop();
                    //sumOfClothes = stack.Pop();

                }
                else
                {
                    racksCount++;
                    sumOfClothes = stack.Pop();
                }
            }

            Console.WriteLine(racksCount);


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _01._The_Fight_for_Gondor
{
    class Program
    {
        static void Main(string[] args)
        {
            int countWaves = int.Parse(Console.ReadLine());
            Queue<int> plates = new Queue<int>(Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray());
            bool isDestr = false;

            for (int i = 1; i <= countWaves; i++)
            {
                Stack<int> orcs = new Stack<int>(Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray());
                if (i % 3 == 0)
                {
                    plates.Enqueue(int.Parse(Console.ReadLine()));
                }

                while (orcs.Any() && plates.Any())
                {
                    if (orcs.Peek() > plates.Peek())
                    {
                        orcs.Push(orcs.Pop() - plates.Peek());
                        plates.Dequeue();
                        if (orcs.Peek() <= 0)
                        {
                            orcs.Pop();
                        }
                    }
                    else if (orcs.Peek() < plates.Peek())
                    {
                        plates.Enqueue(plates.Dequeue() - orcs.Peek());
                        for (int j = 0; j < plates.Count-1; j++)
                        {
                            plates.Enqueue(plates.Dequeue());
                        }
                        orcs.Pop();
                    }
                    else if (orcs.Peek() == plates.Peek())
                    {
                        orcs.Pop();
                        plates.Dequeue();
                    }
                }
                if (!plates.Any())
                {

                    Console.WriteLine("The orcs successfully destroyed the Gondor's defense.");
                    isDestr = true;
                    if (orcs.Any())
                    {
                        Console.WriteLine($"Orcs left: {string.Join(", ", orcs)}");
                    }
                    break;
                }
            }


            
            if (!isDestr)
            {
                Console.WriteLine("The people successfully repulsed the orc's attack.");
            }
            if (plates.Any())
            {
                Console.WriteLine($"Plates left: {string.Join(", ", plates)}");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ReverseStringUsingStack
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();

            Stack<char> stack = new Stack<char>(input);

            //foreach (var symbol in input)
            //{
            //    stack.Push(symbol);
            //}
            
            while(stack.Any())
            {
                Console.Write(stack.Pop());
            }
        }
    }
}
<file_sep>﻿using System;

namespace SumOfTwoNumbers
{
    class Program
    {
        static void Main(string[] args)
        {
            int first = int.Parse(Console.ReadLine());
            int last = int.Parse(Console.ReadLine());
            int magicNum = int.Parse(Console.ReadLine());
            bool foundComb = false;

            int combCounter = 0;
            for(int i = first;i<=last;i++)
            {
                for(int j=first;j<=last;j++)
                {
                    combCounter++;
                    if((i+j)==magicNum)
                    {
                        Console.WriteLine($"Combination N:{combCounter} ({i} + {j} = {magicNum})");
                        foundComb = true;
                        break;
                    }
                }
                if(foundComb)
                {
                    break;
                }
            }
            if(!foundComb)
            {
                Console.WriteLine($"{ combCounter} combinations - neither equals { magicNum}");
            }
        }
    }
}
<file_sep>﻿using P06.FoodShortage.Contracts;

namespace P06.FoodShortage
{
    public class Citizen :  IIdentifiable,IBirthable,IBuyer
    {
        //private string name;
        private int age;
        private string id;
        private string birthdate;
        private int food = 0;
        public Citizen(string name, int age, string id,string birthdate)
        {
            this.Name = name;
            this.age = age;
            this.id = id;
            this.birthdate = birthdate;
        }
        public string Name { get; }

        public int Food 
        { 
            get
            {
                return this.food;
            }
            private set
            {
                this.food = value;
            }
        }

        public void BuyFood()
        {
            this.Food += 10;
        }

        public string GetBirth()
        {
            return this.birthdate;
        }

        //public string Name { get; }

        //public int Age { get; }

        //public string Id { get; }

        public string GetId()
        {
            return this.id;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _11._Key_Revolver
{
    class Program
    {
        static void Main(string[] args)
        {
            int bulletPrice = int.Parse(Console.ReadLine());
            int sizeGunBarrel = int.Parse(Console.ReadLine());
            int[] bulletsInfo = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();
            int[] locksInfo = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();
            int intelligenceValue = int.Parse(Console.ReadLine());

            Stack<int> bullets = new Stack<int>(bulletsInfo);
            Queue<int> locks = new Queue<int>(locksInfo);

            int countShooting = 0;
            int bulletsCost = 0;
            while(bullets.Any() && locks.Any())
            {
                int currBullet = bullets.Pop();
                countShooting++;            
                if(currBullet <= locks.Peek())
                {
                    Console.WriteLine("Bang!");
                    locks.Dequeue();
                }
                else
                {
                    Console.WriteLine("Ping!");
                }
                if (countShooting == sizeGunBarrel && bullets.Any())
                {
                    Console.WriteLine("Reloading!");
                    countShooting = 0;
                }
                bulletsCost += bulletPrice;
                
            }


            if (!locks.Any())
            {
                Console.WriteLine($"{bullets.Count} bullets left. Earned " +
                    $"${intelligenceValue - bulletsCost}");
            }
            else
            {
                Console.WriteLine($"Couldn't get through. Locks left: {locks.Count}");
            }



        }
    }
}
<file_sep>﻿using System;
using System.Text;

namespace _01._Email_Validator
{
    class Program
    {
        static void Main(string[] args)
        {
            string email = Console.ReadLine();

            while (true)
            {
                string input = Console.ReadLine();
                if (input == "Complete")
                {
                    break;
                }
                string[] command = input.Split();

                switch (command[0])
                {
                    case "Make":
                        if (command[1] == "Upper")
                        {
                            email = email.ToUpper();
                            Console.WriteLine(email);
                        }
                        else
                        {
                            email = email.ToLower();
                            Console.WriteLine(email);
                        }
                        break;
                    case "GetDomain":
                        int count = int.Parse(command[1]);
                        string sub = email.Substring(email.Length-count);
                        Console.WriteLine(sub);
                        break;
                    case "GetUsername":
                        if (email.Contains('@'))
                        {
                            int ind = email.IndexOf('@');
                            StringBuilder sb = new StringBuilder();
                            foreach (char c in email)
                            {
                                if (c == '@')
                                {
                                    break;
                                }
                                sb.Append(c);
                            }
                            Console.WriteLine(sb);
                        }
                        else
                        {
                            Console.WriteLine($"The email {email} doesn't contain the @ symbol.");
                        }
                        break;
                    case "Replace":
                        char toReplace = char.Parse(command[1]);
                        email = email.Replace(toReplace, '-');
                        Console.WriteLine(email);
                        break;
                    case "Encrypt":
                        for (int i = 0; i < email.Length; i++)
                        {
                            char currCh = email[i];
                            Console.Write($"{(int)currCh} ");
                        }
                        break;
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace _12._Cups_and_Bottles
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] cupsInfo = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            int[] bottlesInfo = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            Queue<int> cups = new Queue<int>(cupsInfo);
            Stack<int> bottles = new Stack<int>(bottlesInfo);

            int wastedWater = 0;
            while(cups.Any() && bottles.Any())
            {
                int currCup = cups.Peek();
                int currBottle = bottles.Pop();
                if (currBottle >= currCup)
                {
                    cups.Dequeue();
                    wastedWater += currBottle - currCup;
                }
                else
                {
                    currCup -= currBottle;
                    cups.Dequeue();
                    // cups.Enqueue(currCup);
                    while (true)
                    {
                        int nowBottle = bottles.Pop();
                        if (nowBottle < currCup)
                        {
                            currCup -= nowBottle;
                        }
                        else
                        {
                            wastedWater += nowBottle - currCup;
                            break;
                        }
                    }
                }
            }

            if (!cups.Any())
            {
                Console.WriteLine($"Bottles: {string.Join(" ",bottles)}");
            }
            else
            {
                Console.WriteLine($"Cups: {string.Join(" ", cups)}");
            }
            Console.WriteLine($"Wasted litters of water: {wastedWater}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace CountUpperCaseWords
{
    class Program
    {
        static void Main(string[] args)
        {
            Console
                .ReadLine()
                .Split()
                .Where(word => char.IsUpper(word[0]))
                .ToList()
                .ForEach(Console.WriteLine);
                



        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P05.BirthdayCelebrations.Contracts
{
    public interface IBirthable
    {
        string GetBirth();
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._MuOnline
{
    class Program
    {
        static void Main(string[] args)
        {
            int initialHealth = 100;
            int initialBitcoins = 0;
            string[] dungeons = Console.ReadLine().Split('|', StringSplitOptions.RemoveEmptyEntries).ToArray();

            int roomCount = 0;
            for(int i = 0; i < dungeons.Length; i++)
            {
                roomCount++;
                string[] currDungeon = dungeons[i].Split().ToArray();
                string command = currDungeon[0];

                if(command == "potion")
                {
                    int amount = int.Parse(currDungeon[1]);
                    if(initialHealth < 100)
                    {
                        if(initialHealth + amount > 100)
                        {
                            Console.WriteLine($"You healed for {100 - initialHealth} hp.");
                            initialHealth = 100;
                        }
                        else
                        {
                            initialHealth += amount;
                            Console.WriteLine($"You healed for {amount} hp.");
                        }
                    }
                    Console.WriteLine($"Current health: {initialHealth} hp.");
                }
                else if(command == "chest")
                {
                    int amount = int.Parse(currDungeon[1]);
                    initialBitcoins += amount;

                    Console.WriteLine($"You found {amount} bitcoins.");
                }
                else
                {
                    int monsterAttack = int.Parse(currDungeon[1]);
                    initialHealth -= monsterAttack;

                    if(initialHealth > 0)
                    {
                        Console.WriteLine($"You slayed {command}.");
                    }
                    else
                    {
                        Console.WriteLine($"You died! Killed by {command}.");
                        Console.WriteLine($"Best room: {roomCount}");
                        return;
                    }
                }
            }

            Console.WriteLine($"You've made it!");
            Console.WriteLine($"Bitcoins: {initialBitcoins}");
            Console.WriteLine($"Health: {initialHealth}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03.Numbers_2_
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine()
                .Split(' ', StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToList();

            var modifiedList = list
                .Where(x => x > list.Average())
                .OrderByDescending(x => x)
                .Take(5)
                .ToList();

            if (modifiedList.Any())
            {
                Console.WriteLine(string.Join(' ', modifiedList));
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Common;
using System.Linq;
using System.Text;

namespace Rabbits
{
    public class Cage
    {
        private  List<Rabbit> data;
        public Cage(string name , int capacity)
        {
            this.Name = name;
            this.Capacity = capacity;

            data = new List<Rabbit>();
        }
        public int Count
            => data.Count;
        public string Name { get; private set; }
        public int Capacity { get; private set; }

        public void Add(Rabbit rabbit)
        {
            if(this.Count < this.Capacity)
            {
                data.Add(rabbit);
            }
        }
        public bool RemoveRabbit(string name)
        {
            return data.Remove(data.FirstOrDefault(r => r.Name == name));
        }
        public void RemoveSpecies(string species)
        {
            data.RemoveAll(r => r.Species == species);
        }
        public Rabbit SellRabbit(string name)
        {
            Rabbit rabbitToSell = data.FirstOrDefault(r => r.Name == name);
            if(rabbitToSell != null)
            {
                rabbitToSell.Available = false;
            }
            return rabbitToSell;
        }


        public Rabbit[] SellRabbitsBySpecies(string species)
        {
            var rabbitsToSell = data.Where(r => r.Species == species).ToArray();
            foreach (var rabbit in rabbitsToSell)
            {
                rabbit.Available = false;
            }

            return rabbitsToSell;
        }

        public string Report()
        {
            StringBuilder sb = new StringBuilder();
            sb
                .AppendLine($"Rabbits available at {this.Name}:");
            foreach (Rabbit rabbit in data.Where(r => r.Available == true))
            {
                sb.AppendLine(rabbit.ToString());
            }
            return sb.ToString().TrimEnd();

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ReadingList_from_one_line
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            PrintList(list);

        }
        static void PrintList(List<int> list)
        {
            Console.WriteLine(string.Join(" ", list));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P01.Vehicles.Models.Contracts
{
    public interface IDriveable
    {
        string Drive(double kilometers);
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._Legendary_Farming
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] keyMaterialNames = new string[]
            {
                "shards",
                "fragments",
                "motes"
            };

            Dictionary<string, int> keyMaterials = new Dictionary<string, int>();

            Dictionary<string, int> junk = new Dictionary<string, int>();

            string itemObtained = string.Empty;
            bool obtained = false;

            keyMaterials["shards"] = 0;
            keyMaterials["fragments"] = 0;
            keyMaterials["motes"] = 0;

            while (!obtained)
            {
                string[] inputArgs = Console.ReadLine()
                    .Split()
                    .ToArray();
                for (int i = 0; i < inputArgs.Length; i += 2)
                {
                    int qty = int.Parse(inputArgs[i]);
                    string material = inputArgs[i + 1].ToLower();

                    if (keyMaterialNames.Contains(material))
                    {
                        keyMaterials[material] += qty;
                        if(keyMaterials.Any(m => m.Value >= 250))
                        {
                            if(material == "shards")
                            {
                                itemObtained = "Shadowmourne";
                            }
                            else if(material == "fragments")
                            {
                                itemObtained = "Valanyr";
                            }
                            else
                            {
                                itemObtained = "Dragonwrath";
                            }
                            keyMaterials[material] -= 250;
                            obtained = true;
                            break;
                        }
                    }
                    else
                    {
                        AddJunk(junk, qty, material);
                    }
                }
            }
            Console.WriteLine($"{itemObtained} obtained!");

            keyMaterials = keyMaterials.OrderByDescending(kvp => kvp.Value)
                .ThenBy(kvp => kvp.Key)
                .ToDictionary(a => a.Key, b => b.Value);

            foreach (var kvp in keyMaterials)
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value}");
            }

            junk = junk
                .OrderBy(kvp => kvp.Key)
                .ToDictionary(a => a.Key, b => b.Value);
            foreach (var kvp in junk)
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value}");
            }
        }

        private static void AddJunk(Dictionary<string, int> junk, int qty, string material)
        {
            if (!junk.ContainsKey(material))
            {
                junk[material] = 0;
            }
            junk[material] += qty;
        }
    }
}
<file_sep>﻿using P04.WildFarm.Models.Foods;
using System;
using System.Collections.Generic;
using System.Text;

namespace P04.WildFarm.Models.Animals.Mammals.Felines
{
    public class Tiger : Feline
    {
        private const double WEIGHT_MULT = 1.00;
        public Tiger(string name, double weight, string livingRegion, string breed)
            : base(name, weight, livingRegion, breed)
        {
        }

        public override double WeightMultiplier => WEIGHT_MULT;

        public override ICollection<Type> PrefferedFoods
            => new List<Type>() {typeof(Meat) };

        public override void ProduceSound()
        {
            Console.WriteLine("ROAR!!!");
        }
    }
}
<file_sep>﻿using System;

namespace _02._Snake
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            char[,] field = new char[n, n];

            for (int i = 0; i < n; i++)
            {
                string currRow = Console.ReadLine();
                for (int j = 0; j < n; j++)
                {
                    field[i, j] = currRow[j];
                }
            }

            int snakeRow = -1;
            int snakeCol = -1;

            getSnakeCoordinates(n, field, ref snakeRow, ref snakeCol);

            int countFood = 0;
            bool isOut = false;
            while (countFood < 10 && isOut == false)
            {
                string command = Console.ReadLine();
                field[snakeRow, snakeCol] = '.';
                if(command == "up")
                {
                    if(snakeRow - 1 < 0)
                    {
                        isOut = true;
                        continue;
                    }
                    checkPos(field, snakeRow - 1, snakeCol, ref countFood, n, ref snakeRow, ref snakeCol);
                    field[snakeRow, snakeCol] = 'S';
                }
                else if(command == "down")
                {
                    if(snakeRow + 1 == n)
                    {
                        isOut = true;
                        continue;
                    }
                    checkPos(field, snakeRow + 1, snakeCol, ref countFood, n, ref snakeRow, ref snakeCol);
                    field[snakeRow, snakeCol] = 'S';
                }
                else if (command == "left")
                {
                    if (snakeCol - 1 < 0)
                    {
                        isOut = true;
                        continue;
                    }
                    checkPos(field, snakeRow, snakeCol - 1, ref countFood, n, ref snakeRow, ref snakeCol);
                    field[snakeRow, snakeCol] = 'S';
                }
                else
                {
                    if (snakeCol + 1 == n)
                    {
                        isOut = true;
                        continue;
                    }
                    checkPos(field, snakeRow, snakeCol + 1, ref countFood, n, ref snakeRow, ref snakeCol);
                    field[snakeRow, snakeCol] = 'S';
                }

            }

            if(isOut == true)
            {
                Console.WriteLine("Game over!");
            }
            if(countFood >= 10)
            {
                Console.WriteLine("You won! You fed the snake.");
            }
            Console.WriteLine($"Food eaten: {countFood}");

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    Console.Write(field[i, j]);
                }
                Console.WriteLine();
            }
            
        }
        public static void checkPos(char[,] field, int changedRow, int changedCol, ref int foodQuantity,
                                    int n, ref int snakeRow, ref int snakeCol)
        {
            if(field[changedRow, changedCol] == '*')
            {
                foodQuantity++;
                snakeRow = changedRow;
                snakeCol = changedCol;
            }
            else if(field[changedRow, changedCol] == 'B')
            {
                field[changedRow, changedCol] = '.';
                int burrowRow = -1;
                int burrowCol = -1;
                for(int row = 0; row < n; row++)
                {
                    for(int col = 0; col < n; col++)
                    {
                        if(field[row, col] == 'B')
                        {
                            burrowRow = row;
                            burrowCol = col;
                        }
                    }
                }
                snakeRow = burrowRow;
                snakeCol = burrowCol;
            }
            else
            {
                snakeRow = changedRow;
                snakeCol = changedCol;
            }
        }
        public static void getSnakeCoordinates(int n, char[,] field, ref int snakeRow, ref int snakeCol)
        {
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if(field[i, j] == 'S')
                    {
                        snakeRow = i;
                        snakeCol = j;
                    }
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _04._Largest_3_Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            //List<int> nums = Console.ReadLine()
            //    .Split()
            //    .Select(int.Parse)
            //    .ToList();

            //List<int> sortedNums = nums.OrderByDescending(x => x)
            //    .ToList();


            ////OTHER WAY
            List<int> nums = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .OrderByDescending(x=>x)
                .Take(3)
                .ToList();

            //for (int i = 0; i < 3 && i<sortedNums.Count; i++)
            //{
               
            //    Console.Write($"{sortedNums[i]} ");

            //}
            Console.WriteLine(string.Join(" ", nums));
        }
    }
}
<file_sep>﻿using System;

namespace _01.Person
{
    class Program
    {
        static void Main(string[] args)
        {
           
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._Array_Modifier
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Console.ReadLine()
                .Split(' ',StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();

            string input;
            while((input = Console.ReadLine()) != "end")
            {
                string[] command = input
                    .Split(' ',StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();
                if(command[0] == "swap")
                {
                    int index1 = int.Parse(command[1]);
                    int index2 = int.Parse(command[2]);

                    int tmp = arr[index1];
                    arr[index1] = arr[index2];
                    arr[index2] = tmp;
                }
                else if(command[0] == "multiply")
                {
                    int index1 = int.Parse(command[1]);
                    int index2 = int.Parse(command[2]);

                    arr[index1] = arr[index1] * arr[index2];
                }
                else
                {
                    for(int i = 0; i < arr.Length; i++)
                    {
                        arr[i]--;
                    }
                }


            }

            Console.WriteLine(string.Join(", ", arr));

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace Try
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(LengthOfLongestSubstring("aab"));
        }

        public static int LengthOfLongestSubstring(string s)
        {
            Dictionary<char, int> countChar = new Dictionary<char, int>();
            int counter = 0;
            int maxCounter = 0;
            foreach (char c in s)
            {
                counter++;
                if (countChar.ContainsKey(c))
                {
                    countChar[c]++;
                    countChar = null;
                    countChar = new Dictionary<char, int>();
                    
                    counter = 0;
                    //continue;
                }
                else
                {
                    countChar[c] = 0;
                }
                if (maxCounter < counter)
                {
                    maxCounter = counter;
                }
            }
            return maxCounter;
        }
    }
}
<file_sep>﻿using System;

namespace _02._Vowels_Count
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            Console.WriteLine(VowelCount(str));
        }
        static int VowelCount(string str)
        {
            string newStr = str.ToLower();
            int counter = 0;
            foreach (char letter in newStr)
            {
                if(letter == 'a' || letter == 'e' || letter == 'i' || letter == 'o' || letter == 'u')
                {
                    counter++;
                }
            }
            return counter;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public abstract class Vehicle : IVehicle
    {
        public string Model { get; set; }

        public virtual string VrumVrum()
        {
            return "Vehicle is moving";
        }
    }
}
<file_sep>﻿using CounterStrike.Models.Maps.Contracts;
using CounterStrike.Models.Players.Contracts;
using CounterStrike.Utilities.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CounterStrike.Models.Maps
{
    public class Map : IMap
    {
        public string Start(ICollection<IPlayer> players)
        {
            var terrorists = players.Where(p => p.GetType().Name == "Terrorist");
            var counterTerrorists = players.Where(p => p.GetType().Name == "CounterTerrorist");

            ////////
            while(terrorists.Any(p => p.IsAlive) && counterTerrorists.Any(c => c.IsAlive))
            {
                foreach (IPlayer terrorist in terrorists.Where(t => t.IsAlive))
                {
                    int damage = terrorist.Gun.Fire();
                    foreach (IPlayer counterTerrorist in counterTerrorists.Where(c => c.IsAlive))
                    {
                        counterTerrorist.TakeDamage(damage);
                    }
                }

                foreach (IPlayer counterTerrorist in counterTerrorists.Where(t => t.IsAlive))
                {
                    int damage = counterTerrorist.Gun.Fire();
                    foreach (IPlayer terrorist in terrorists.Where(c => c.IsAlive))
                    {
                        terrorist.TakeDamage(damage);
                    }
                }
            }
            if(terrorists.Any(t => t.IsAlive))
            {
                return "Terrorist wins!";
            }
            else 
            {
                return "Counter Terrorist wins!";
            }


        }
    }
}
<file_sep>﻿using P01.Vehicles.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace P01.Vehicles.Models
{
    public class Bus : Vehicle
    {
        public Bus(double fuelquantity, double fuelconsumption, double tankCapacity)
            : base(fuelquantity, fuelconsumption, tankCapacity)
        {
        }

        public override string Drive(double kilometers)
        {
            double fuelNeeded = kilometers * (this.FuelConsumption + 1.4);

            if (this.FuelQuantity < fuelNeeded)
            {
                throw new InvalidOperationException(string
                    .Format(ExceptionMessage.NotEnoughFuelExceptionMessage
                    , this.GetType().Name));
            }

            this.FuelQuantity -= fuelNeeded;
            return $"{this.GetType().Name} travelled {kilometers} km";
        }
        

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _09.ForceBook
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, List<string>> book = new Dictionary<string, List<string>>();

            while (true)
            {
                string inp = Console.ReadLine();
                if (inp == "Lumpawaroo")
                {
                    break;
                }
                string[] inputArgs = inp
                    .Split(new string[] { " | ", " -> " }, StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();
                if (inp.Contains("|"))
                {
                    string side = inputArgs[0];
                    string user = inputArgs[1];

                    AddUser(book, side, user);
                }
                else if (inp.Contains("->"))
                {
                    string user = inputArgs[0];
                    string side = inputArgs[1];

                    MoveUserToSide(book, user, side);

                }


            }
            PrintOutput(book);

        }

        private static void PrintOutput(Dictionary<string, List<string>> book)
        {
            Dictionary<string, List<string>> orderedBook = book
                            .Where(kvp => kvp.Value.Count > 0)
                            .OrderByDescending(kvp => kvp.Value.Count)
                            .ThenBy(kvp => kvp.Key)
                            .ToDictionary(a => a.Key, b => b.Value);

            foreach (var kvp in orderedBook)
            {
                string currentSide = kvp.Key;
                List<string> currentSideUsers = kvp.Value
                    .OrderBy(x => x)
                    .ToList();
                Console.WriteLine($"Side: {currentSide}, Members: {currentSideUsers.Count}");
                foreach (var name in currentSideUsers)
                {
                    Console.WriteLine($"! {name}");
                }
            }
        }

        static void AddUser(Dictionary<string, List<string>> book, string side, string user)
        {
            if (!book.ContainsKey(side))
            {
                book[side] = new List<string>();
            }
            if (!book.Values.Any(l => l.Contains(user))) /////To try without Any just Contains
            {
                book[side].Add(user);
            }
        }

        static void MoveUserToSide(Dictionary<string, List<string>> book, string user, string side)
        {
            foreach (var kvp in book)
            {
                if (kvp.Value.Contains(user))
                {
                    kvp.Value.Remove(user);
                }
                
            }
            if (!book.ContainsKey(side))
                {
                    book[side] = new List<string>();
                }

                book[side].Add(user);
                Console.WriteLine($"{user} joins the {side} side!");
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace _01._Cooking
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> liquids = new Queue<int>(Console.ReadLine().Split(' ').Select(int.Parse).ToArray());
            Stack<int> ingredients = new Stack<int>(Console.ReadLine().Split(' ').Select(int.Parse).ToArray());

            Dictionary<int, string> itemsTable = new Dictionary<int, string>()
            {
                {25, "Bread" },
                {50, "Cake" },
                {75, "Pastry" },
                {100, "Fruit Pie"}
            };

            Dictionary<string, int> cookedItems = new Dictionary<string, int>()
            {
                {"Bread", 0 },
                {"Cake", 0 },
                {"Pastry", 0 },
                {"Fruit Pie", 0 }
            };

            while (liquids.Count > 0 && ingredients.Count > 0)
            {
                int sum = liquids.Peek() + ingredients.Peek();
                if(itemsTable.ContainsKey(sum))
                {
                    string itemName = itemsTable[sum];
                    cookedItems[itemName]++;
                    liquids.Dequeue();
                    ingredients.Pop();
                }
                else
                {
                    liquids.Dequeue();
                    int popped = ingredients.Pop();
                    ingredients.Push(popped + 3);
                }
            }

            if(cookedItems.All(kvp => kvp.Value >= 1))
            {
                Console.WriteLine($"Wohoo! You succeeded in cooking all the food!");
            }
            else
            {
                Console.WriteLine("Ugh, what a pity! You didn't have enough materials to cook everything.");
            }

            if(liquids.Any())
            {
                Console.WriteLine($"Liquids left: {string.Join(", ", liquids)}");
            }
            else
            {
                Console.WriteLine("Liquids left: none");
            }

            if (ingredients.Any())
            {
                Console.WriteLine($"Ingredients left: {string.Join(", ", ingredients)}");
            }
            else
            {
                Console.WriteLine("Ingredients left: none");
            }

            cookedItems = cookedItems.OrderBy(kvp => kvp.Key).ToDictionary(x => x.Key, y => y.Value);

            foreach (var kvp in cookedItems)
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value}");
            }
        }
    }
}
<file_sep>﻿using System;

namespace _01._National_Court
{
    class Program
    {
        static void Main(string[] args)
        {
            int countPeoplePerHour1 = int.Parse(Console.ReadLine());
            int countPeoplePerHour2 = int.Parse(Console.ReadLine());
            int countPeoplePerHour3 = int.Parse(Console.ReadLine());

            int allPeoplePerHour = countPeoplePerHour1 + countPeoplePerHour2 + countPeoplePerHour3;

            int peopleCount = int.Parse(Console.ReadLine());
            int timeNeeded = 0;
            while(peopleCount > 0)
            {
                timeNeeded++;
                if(timeNeeded % 4 == 0)
                {
                    timeNeeded++;
                }
                if (allPeoplePerHour >= peopleCount)
                {
                    break;
                }
                else
                {
                    peopleCount -= allPeoplePerHour;
                }
            }
            Console.WriteLine($"Time needed: {timeNeeded}h.");
        }
    }
}
<file_sep>﻿using System;

namespace OldBooks
{
    class Program
    {
        static void Main(string[] args)
        {
            string searchedBook = Console.ReadLine();
            string bookName = Console.ReadLine();
            int countbooks = 0;
            bool isfound = false;

            while (bookName != "No More Books") 
            {
                if (bookName == searchedBook)
                {
                    isfound = true;
                    break;
                }
                else
                {
                    countbooks++;
                    bookName = Console.ReadLine();
                }
            }
            if(isfound == true)
            {
                Console.WriteLine($"You checked {countbooks} books and found it.");
            }
            else
            {
                Console.WriteLine("The book you search is not here!");
                Console.WriteLine($"You checked {countbooks} books.");
            }
        }
    }
}
<file_sep>﻿using System;

namespace _10.Rage_Expenses
{
    class Program
    {
        static void Main(string[] args)
        {
            int lostGames = int.Parse(Console.ReadLine());
            float headsetPrice = float.Parse(Console.ReadLine());
            float mousePrice = float.Parse(Console.ReadLine());
            float keyboardPrice = float.Parse(Console.ReadLine());
            float displayPrice = float.Parse(Console.ReadLine());

            float expenses = 0;
            int countTrashedKeyboard = 0;

            for (int i = 1; i <= lostGames; i++)
            {
                if(i % 2 == 0)
                {
                    expenses += headsetPrice;
                }
                if (i % 3 == 0)
                {
                    expenses += mousePrice;
                }
                if(i % 2 == 0 && i % 3 == 0)
                {
                    expenses += keyboardPrice;
                    countTrashedKeyboard++;
                }
                if(countTrashedKeyboard == 2)
                {
                    expenses += displayPrice;
                    countTrashedKeyboard = 0;
                }
            }

            Console.WriteLine($"Rage expenses: {expenses:F2} lv.");
        }
    }
}
<file_sep>﻿using SantaWorkshop.Core.Contracts;
using SantaWorkshop.Models.Dwarfs;
using SantaWorkshop.Models.Dwarfs.Contracts;
using SantaWorkshop.Models.Instruments;
using SantaWorkshop.Models.Instruments.Contracts;
using SantaWorkshop.Models.Presents;
using SantaWorkshop.Models.Presents.Contracts;
using SantaWorkshop.Models.Workshops;
using SantaWorkshop.Repositories;
using SantaWorkshop.Repositories.Contracts;
using SantaWorkshop.Utilities.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SantaWorkshop.Core
{
    public class Controller : IController
    {
        private DwarfRepository dwarfs;
        private PresentRepository presents;

        public Controller()
        {
            this.dwarfs = new DwarfRepository();
            this.presents = new PresentRepository();
        }

        public string AddDwarf(string dwarfType, string dwarfName)
        {
            //"HappyDwarf" and "SleepyDwarf".
            IDwarf dwarf = null;
            if(dwarfType == "HappyDwarf")
            {
                dwarf = new HappyDwarf(dwarfName);
            }
            else if(dwarfType == "SleepyDwarf")
            {
                dwarf = new SleepyDwarf(dwarfName);
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDwarfType);
            }
            dwarfs.Add(dwarf);
            return string.Format(OutputMessages.DwarfAdded, dwarfType, dwarfName);
        }

        public string AddInstrumentToDwarf(string dwarfName, int power)
        {
            if(this.dwarfs.FindByName(dwarfName) == null)
            {
                throw new InvalidOperationException(ExceptionMessages.InexistentDwarf);
            }

            IDwarf dwarf = dwarfs.FindByName(dwarfName);
            IInstrument instrument = new Instrument(power);

            dwarf.AddInstrument(instrument);
            return string.Format(OutputMessages.InstrumentAdded,power,dwarfName);
        }

        public string AddPresent(string presentName, int energyRequired)
        {
            IPresent present = new Present(presentName, energyRequired);
            presents.Add(present);

            return string.Format(OutputMessages.PresentAdded,presentName);
        }

        public string CraftPresent(string presentName)
        {
            IPresent present = presents.FindByName(presentName);
            ICollection<IDwarf> dwarves = dwarfs
                .Models
                .Where(d => d.Energy >= 50)
                .OrderByDescending(d => d.Energy)
                .ToList();

            if(dwarves.Count == 0)
            {
                throw new InvalidOperationException(ExceptionMessages.DwarfsNotReady);
            }

            Workshop workshop = new Workshop();

            while(dwarves.Any())
            {
                IDwarf currDwarf = dwarves.First();
                workshop.Craft(present, currDwarf);
                if (!currDwarf.Instruments.Any())
                {
                    dwarves.Remove(currDwarf);
                }
                if(currDwarf.Energy == 0)
                {
                    dwarves.Remove(currDwarf);
                    this.dwarfs.Remove(currDwarf);
                }
                if (present.IsDone())
                {
                    return string.Format(OutputMessages.PresentIsDone,presentName);
                }

            }
            ///////PresentISDone
            return string.Format(OutputMessages.PresentIsNotDone, presentName);

        }

        public string Report()
        {
            StringBuilder sb = new StringBuilder();
            int countCraftedPresents = this.presents
                .Models
                .Count(p => p.IsDone());



            sb
                .AppendLine($"{countCraftedPresents} presents are done!")
                .AppendLine($"Dwarfs info:");

            foreach (IDwarf dwarf in this.dwarfs.Models)
            {
                int countNotBrokenInstruments = dwarf
                    .Instruments
                    .Count(i => !i.IsBroken());
                sb
                    .AppendLine($"Name: {dwarf.Name}")
                    .AppendLine($"Energy: {dwarf.Energy}")
                    .AppendLine($"Instruments: {countNotBrokenInstruments} not broken left");
            }

            return sb.ToString().TrimEnd();
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace _01._Bombs
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> bombEffects = new Queue<int>(
                Console.ReadLine()
                .Split(", ")
                .Select(int.Parse).ToList());

            Stack<int> bombCasing = new Stack<int>(
                Console.ReadLine()
                .Split(", ")
                .Select(int.Parse).ToList());

            Dictionary<int, string> typeBombs = new Dictionary<int, string>()
            {
                { 40, "Datura Bombs" },
                { 60, "Cherry Bombs" },
                { 120, "Smoke Decoy Bombs"}

            };

            Dictionary<string, int> bombPouch = new Dictionary<string, int>()
            {
                { "Datura Bombs", 0 },
                { "Cherry Bombs", 0 },
                { "Smoke Decoy Bombs", 0}
            };

            while(bombEffects.Any() && bombCasing.Any() && bombPouch.Any(kvp => kvp.Value < 3))
            {
                int sum = bombEffects.Peek() + bombCasing.Peek();
                
                if(typeBombs.Any(kvp => kvp.Key == sum))
                {
                    string newBombName = typeBombs[sum];
                    bombPouch[newBombName]++;
                    bombEffects.Dequeue();
                    bombCasing.Pop();
                }
                else
                {
                    int prevBombCasing = bombCasing.Pop();
                    bombCasing.Push(prevBombCasing - 5);
                }
            }

            if(bombPouch.All(kvp => kvp.Value >= 3))
            {
                Console.WriteLine("Bene! You have successfully filled the bomb pouch!");
            }
            else
            {
                Console.WriteLine("You don't have enough materials to fill the bomb pouch.");
            }

            if(bombEffects.Any())
            {
                Console.WriteLine($"Bomb Effects: {string.Join(", ", bombEffects)}");
            }
            else
            {
                Console.WriteLine("Bomb Effects: empty");
            }
            if (bombCasing.Any())
            {
                Console.WriteLine($"Bomb Casings: {string.Join(", ", bombCasing)}");
            }
            else
            {
                Console.WriteLine("Bomb Casings: empty");
            }

            foreach(var kvp in bombPouch.OrderBy(kvp => kvp.Key))
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value}");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Text;

namespace _04.Caesar_Cipher
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = Console.ReadLine();
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < text.Length; i++)
            {
                char letter = text[i];
                letter = (char)(letter + 3);
                sb.Append(letter);
            }
            Console.WriteLine(sb);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _05.Softuni_Parking
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            Dictionary<string, string> parking = new Dictionary<string, string>();

            for (int i = 0; i < n; i++)
            {
                string[] command = Console.ReadLine().Split();
                if(command[0] == "register")
                {
                    string user = command[1];
                    string plate = command[2];

                    if (!parking.ContainsKey(user))
                    {
                        parking[user] = plate;

                        Console.WriteLine($"{user} registered {plate} successfully");
                    }
                    else
                    {
                        Console.WriteLine($"ERROR: already registered with plate number {parking[user]}");
                    }
                }
                else if(command[0] == "unregister")
                {
                    string user = command[1];                   
                    if (!parking.Any(c => c.Key == user))
                    {
                        Console.WriteLine($"ERROR: user {user} not found");
                    }
                    else
                    {
                        parking.Remove(user);
                        Console.WriteLine($"{user} unregistered successfully");
                        //foreach (var kvp in parking)
                        //{
                        //    if(kvp.Key == user)
                        //    {
                        //        parking.Remove(kvp.Key);
                        //    }
                        //}
                    }
                }
            }
            foreach (var kvp in parking)
            {
                Console.WriteLine($"{kvp.Key} => {kvp.Value}");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._The_Lift
{
    class Program
    {
        static void Main(string[] args)
        {
            int peopleWaiting = int.Parse(Console.ReadLine());
            int[] lift = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            for (int i = 0; i < lift.Length && peopleWaiting != 0; i++)
            {
                if(lift[i] < 4)
                {
                    int peopleCanEnter = 4 - lift[i];
                    if(peopleWaiting >= peopleCanEnter)
                    {
                        peopleWaiting -= peopleCanEnter;
                        lift[i] += peopleCanEnter;
                    }
                    else if(peopleWaiting < peopleCanEnter)
                    {
                        while(peopleWaiting > 0)
                        {
                            peopleWaiting--;
                            lift[i]++;
                        }
                    }
                }
                else
                {
                    continue;
                }
            }


            if(peopleWaiting == 0 && lift.Any(w => w < 4))
            {
                Console.WriteLine("The lift has empty spots!");
                Console.WriteLine(string.Join(' ',lift));
            }
            else if(peopleWaiting > 0 && lift.All(w => w == 4))
            {
                Console.WriteLine($"There isn't enough space! {peopleWaiting} people in a queue!");
                Console.WriteLine(string.Join(' ', lift));
            }
            else if(lift.All(w => w == 4) && peopleWaiting == 0)
            {
                Console.WriteLine(string.Join(' ', lift));
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestApp
{
    public class Calculator
    {
        public int CalculateSum(params int[] numbers)
        {
            return numbers.Sum();
        }

        public int Product(params int[] numbers)
        {
            int result = 1;

            for (int i = 0; i < numbers.Length; i++)
            {
                result *= numbers[i];
            }

            return result;
        }
    }
}
<file_sep>﻿using P08.CollectionHierarchy.Contracts;
using System;
using System.Collections.Generic;
using System.Text;

namespace P08.CollectionHierarchy.Models
{
    public class MyList : IMyList
    {
        private List<string> data;
        private List<int> indexes;
        private List<string> removedElements;
        public MyList()
        {
            this.data = new List<string>();
            this.indexes = new List<int>();
            this.removedElements = new List<string>();
        }

        public int Used 
        {
            get
            {
                return this.data.Count;
            }
        }

        public void Add(string element)
        {
            this.indexes.Add(0);
            this.data.Insert(0, element);
        }

        public void Remove()
        {
            string itemToRemove = this.data[0];
            this.removedElements.Add(itemToRemove);
            this.data.RemoveAt(0);
        }
        public void GetRemoved()
        {
            Console.WriteLine(string.Join(" ", this.removedElements));
        }
        public override string ToString()
        {
            return $"{string.Join(" ", this.indexes)}";
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Inheritance
{
    public class Programmer:Employee
    {
        public string Language { get; set; }

    }
}
<file_sep>﻿using System;
using System.Runtime.CompilerServices;

namespace P07.Tuple
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] personInfo = Console.ReadLine()
                .Split();
            string fullName = $"{personInfo[0]} {personInfo[1]}";
            string address = personInfo[2];

            string[] nameAndBeer = Console.ReadLine().Split();
            string name = nameAndBeer[0];
            int beerAmount = int.Parse(nameAndBeer[1]);

            string[] thirdInput = Console.ReadLine().Split();
            int firstArg = int.Parse(thirdInput[0]);
            double secondArg = double.Parse(thirdInput[1]);

            Tuple<string, string> firstTuple = new Tuple<string, string>(fullName, address);
            Tuple<string, int> secondTuple = new Tuple<string, int>(name, beerAmount);
            Tuple<int, double> thirdTuple = new Tuple<int, double>(firstArg, secondArg);

            Console.WriteLine(firstTuple);
            Console.WriteLine(secondTuple);
            Console.WriteLine(thirdTuple);

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace ReadingList
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = new List<int>();
            int n = int.Parse(Console.ReadLine());
            ReadList(list, n);
            PrintList(list);
           
        }
        static void PrintList(List <int> list)
        {
            //for (int i = 0; i < list.Count; i++)
            //{
            //    Console.WriteLine(list[i]);
            //}
            Console.WriteLine(string.Join(" ", list));
        }
        static void ReadList(List<int> list, int n)
        {
            for (int i = 0; i < n; i++)
            {
                list.Add(int.Parse(Console.ReadLine()));
            }
            
            
            //return array;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Objects
{
    class Cars
    {
       public string color = "red";
        public int maxSpeed = 10;
        public void Suobsht()
        {
            Console.WriteLine("BRUM BRUM");
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _09._List_Of_Predicates
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] dividers = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            Predicate<int> isDivisable = new Predicate<int>((n) 
                => dividers.All(d => n % d == 0));

            Action<int, int[]> FindDivisableNums = new Action<int, int[]>((n, dividers) =>
             {
                 for (int i = 1; i <= n; i++)
                 {
                     if (isDivisable(i))
                     {
                         Console.Write(i + " ");
                     }
                 }
             });

            FindDivisableNums(n, dividers);
        }
    }
}
<file_sep>﻿using System;

namespace Clock
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 0;i<24;i++)
            {
                for(int j= 0;j<60;j++)
                {
                    Console.WriteLine($"{i}:{j}");
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace Sorting
{
    class Program
    {
        static void Main(string[] args)
        {
            ///////Selection sort
            List<int> list = new List<int>() { 4, 3, 2, 1 };
            for (int i = 0; i < list.Count; i++)
            {
                int min = list[i];
                int minIndex = i;
                for (int j = i; j < list.Count; j++)
                {
                    if(list[j] < min)
                    {
                        min = list[j];
                        minIndex = j;
                    }
                }
                int temp = list[i];
                list[i] = list[minIndex];
                list[minIndex] = temp;
            }
            Console.WriteLine(string.Join(" ", list));


            /////////Bubble sort
            List<int> list2 = new List<int>() { 4, 3, 2, 1 };
            for (int i = 0; i < list2.Count; i++)
            {
                for (int j = i+1; j < list2.Count; j++)
                {
                    if(list2[i] > list2[j])
                    {
                        int temp = list2[i];
                        list2[i] = list2[j];
                        list2[j] = temp; 
                    }
                }
            }


            Console.WriteLine(string.Join(" ", list2));



            
        }
    }
}
<file_sep>﻿using P06.FoodShortage.Contracts;
using P06.FoodShortage.Models;
using System;
using System.Collections.Generic;
using System.Linq;

namespace P06.FoodShortage
{
    public class Engine
    {
        public void Run()
        {
            // List<string> allIds = new List<string>();
            //   List<IIdentifiable> citizens = new List<IIdentifiable>();
            // List<IIdentifiable> robots = new List<IIdentifiable>();

            // List<IIdentifiable> robotsAndCitizens = new List<IIdentifiable>();
            //List<IBirthable> birthables = new List<IBirthable>();

            List<IBuyer> buyers = new List<IBuyer>();
            List<Citizen> citizens = new List<Citizen>();
            List<Rebel> rebels = new List<Rebel>();

            //string command;
            int N = int.Parse(Console.ReadLine());
            for (int i = 0; i < N; i++)
            {
                string[] commandArgs = Console.ReadLine()
                    .Split()
                    .ToArray();

                if(commandArgs.Length == 4)
                {
                    string name = commandArgs[0];
                    int age = int.Parse(commandArgs[1]);
                    string id = commandArgs[2];
                    string birthdate = commandArgs[3];
                    
                    if(!citizens.Any(c=>c.Name == name) && !rebels.Any(r=>r.Name == name))
                    {
                        Citizen citizen = new Citizen(name, age, id,birthdate);
                        
                        citizens.Add(citizen);
                        buyers.Add(citizen);
                    }

                    //  citizens.Add(citizen);
                   // robotsAndCitizens.Add(citizen);
                  //  birthables.Add(citizen);
                }
                else if(commandArgs.Length == 3)
                {
                    string name = commandArgs[0];
                    int age = int.Parse(commandArgs[1]);
                    string group = commandArgs[2];

                    if (!citizens.Any(c => c.Name == name) && !rebels.Any(r => r.Name == name))
                    {
                        Rebel rebel = new Rebel(name, age, group);

                        rebels.Add(rebel);
                        buyers.Add(rebel);
                    }


                }

            }
 
            string command;
            while((command = Console.ReadLine()) != "End")
            {
                string name = command;
                if(citizens.Any(c => c.Name == name))
                {
                    IBuyer buyer = citizens.Find(c => c.Name == name);
                    buyer.BuyFood();
                }
                else if(rebels.Any(r => r.Name == name))
                {
                    IBuyer buyer = rebels.Find(r => r.Name == name);
                    buyer.BuyFood();
                }
            }
            int sumFood = 0;
            foreach (IBuyer buyer in buyers)
            {
                sumFood += buyer.Food;
            }
            Console.WriteLine(sumFood);

            
           

        }
       
    }
}
<file_sep>﻿using System;
using System.Security.Cryptography;

namespace RandomType
{
    class Program
    {
        static void Main(string[] args)
        {
            Random random = new Random();
            int result = random.Next(0, 2);
            Console.WriteLine(result);
        }
    }
}
<file_sep>﻿using System;

namespace BirthdayParty
{
    class Program
    {
        static void Main(string[] args)
        {
            double naem = double.Parse(Console.ReadLine());
            double neobhodimBudget = naem + naem * 0.2 + (naem * 0.2 - naem * 0.2 * 0.45) + ( naem/3) ;

           /* Console.WriteLine(naem * 0.2);
            Console.WriteLine(naem * 0.2 - naem * 0.2 * 0.45);
            Console.WriteLine(naem/3);
            */
            Console.WriteLine(neobhodimBudget);
        }
    }
}
<file_sep>﻿using System;

namespace OnTImeForExam
{
    class Program
    {
        static void Main(string[] args)
        {
            int examhour = int.Parse(Console.ReadLine());
            int examminutes = int.Parse(Console.ReadLine());
            int hourThere = int.Parse(Console.ReadLine());
            int minutesThere = int.Parse(Console.ReadLine());

            int examInMinutes = examhour * 60 + examminutes;
            int ThereInMinutes = hourThere * 60 + minutesThere;
          //  Console.WriteLine(examInMinutes);
          //  Console.WriteLine(ThereInMinutes);
             
            if(ThereInMinutes > examInMinutes)
            {
                Console.WriteLine("Late");
                if(ThereInMinutes - examInMinutes < 60)
                {
                    Console.WriteLine($"{ThereInMinutes - examInMinutes} minutes after the start");
                }
                else
                {
                    if ((ThereInMinutes - examInMinutes) % 60 >= 10)
                    {
                        Console.WriteLine($"{(ThereInMinutes - examInMinutes) / 60}:{(ThereInMinutes - examInMinutes) % 60} hours after the start");
                    }
                    else
                    {
                        Console.WriteLine($"{(ThereInMinutes - examInMinutes) / 60}:0{(ThereInMinutes - examInMinutes) % 60} hours after the start");
                    }
                }
            }
            else if((ThereInMinutes == examInMinutes) || (ThereInMinutes >= examInMinutes - 30) )
            {
                Console.WriteLine("On time");
                if(ThereInMinutes >= examInMinutes - 30)
                {
                    Console.WriteLine($"{examInMinutes - ThereInMinutes} minutes before the start");
                }
            }
            else if( ThereInMinutes < examInMinutes - 30)
            {
                Console.WriteLine("Early");
                if(examInMinutes - ThereInMinutes >=60)
                {   if ((examInMinutes - ThereInMinutes) % 60 >= 10)
                        Console.WriteLine($"{(examInMinutes - ThereInMinutes) / 60}:{(examInMinutes - ThereInMinutes) % 60} hours before the start");
                    else
                    {
                        Console.WriteLine($"{(examInMinutes - ThereInMinutes) / 60}:0{(examInMinutes - ThereInMinutes) % 60} hours before the start");
                    }
                }
                else
                {
                    Console.WriteLine($"{examInMinutes - ThereInMinutes} minutes before the start");
                }
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace SoftUniParking
{
    public class Parking
    {
        private readonly ICollection<Car> cars;
        private int capacity;
        
        public Parking(int capacity)
        {
            this.capacity = capacity;

            this.cars = new List<Car>();
        }

        public IReadOnlyCollection<Car> Cars
            => (IReadOnlyCollection<Car>)this.cars;

        public int Count
            => this.Cars.Count;

        public string AddCar(Car car)
        {
            if(this.Cars.Any(c => c.RegistrationNumber == car.RegistrationNumber))
            {
                return "Car with that registration number, already exists!";
                //return false;
            }
            else if(this.capacity == this.Count)
            {
                return "Parking is full!";
            }
            else
            {
                this.cars.Add(car);
                return $"Successfully added new car {car.Make} {car.RegistrationNumber}";
            }
        }
        public string RemoveCar(string registrNum)
        {
            if(!this.Cars.Any(c => c.RegistrationNumber == registrNum))
            {
                return "Car with that registration number, doesn't exist!";
            }
            else
            {
                var carToRemove = this.Cars.First(c => c.RegistrationNumber == registrNum);
                this.cars.Remove(carToRemove);

                return $"Successfully removed {registrNum}";
            }
        }
        public Car GetCar(string registrNum)
        {
            Car carNeeded = null;
            if(this.Cars.Any(c => c.RegistrationNumber == registrNum))
            {
                 carNeeded = this.Cars.FirstOrDefault(c => c.RegistrationNumber == registrNum);
                
            }
            return carNeeded;

        }
        public void RemoveSetOfRegistrationNumber(List<string> RegistrationNumbers)
        {
            foreach (var rNum in RegistrationNumbers)
            {
                this.RemoveCar(rNum);
            }
        }

    }
}
<file_sep>﻿using System;

namespace SquareArea
{
    class Program
    {
        static void Main(string[] args)
        {
            int side = int.Parse(Console.ReadLine());
            int lice = side * side;
            Console.WriteLine(lice);
        }
    }
}
<file_sep>﻿using System;

namespace _02.Repeat_Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] words = Console.ReadLine().Split();

            string result = "";

            for (int i = 0; i < words.Length; i++)
            {
                string word = words[i];
                for (int j = 0; j < word.Length; j++)
                {
                    result += word;
                }
                //Console.Write(new string(word.ToCharArray(),0, word.Length));
            }
            Console.WriteLine(result);
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _04._Password_Validator
{
    class Program
    {
        static void Main(string[] args)
        {
            string pass = Console.ReadLine();
            if(pass.Length >= 6 && pass.Length <= 10 && pass.All(char.IsLetterOrDigit) && pass.Count(char.IsDigit) >= 2)
            {
                Console.WriteLine("Password is valid");
            }
            else 
            { 
            IsPassBetweenRequirements(pass);
            DoesConsistsOfLettersAndDigits(pass);
            DoesHaveAtLeast2Digits(pass);
            }
    }
        static void IsPassBetweenRequirements(string pass)
        {
            if(pass.Length < 6 || pass.Length > 10)
            {
                Console.WriteLine("Password must be between 6 and 10 characters");
            }
        }
        static void DoesConsistsOfLettersAndDigits(string pass)
        {
           if(!pass.All(char.IsLetterOrDigit))
            {
                Console.WriteLine("Password must consist only of letters and digits");
            }
        }
        static void DoesHaveAtLeast2Digits(string pass)
        {
            //int count = 0;
            //for (int i = 0; i < pass.Length; i++)
            //{
            //    if (char.IsDigit(pass[i]))
            //    {
            //        count++;
            //    }
            //}
            //if(count < 2)
            //{
            //    Console.WriteLine("Password must have at least 2 digits");
            //}
            if (pass.Count(char.IsDigit) < 2)
            {
                Console.WriteLine("Password must have at least 2 digits");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _08._Ranking
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, string> contests = new Dictionary<string, string>();

            string command1;
            while((command1 = Console.ReadLine()) != "end of contests")
            {
                string[] cmdArgs = command1
                    .Split(":", StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();
                string contestName = cmdArgs[0];
                string pass = cmdArgs[1];

                contests[contestName] = pass;
            }

            Dictionary<string, Dictionary<string, int>> users = new
                Dictionary<string, Dictionary<string, int>>();

            string command2;
            while ((command2 = Console.ReadLine()) != "end of submissions")
            {
                string[] cmdArgs = command2
                    .Split("=>", StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();

                string contestName = cmdArgs[0];
                string pass = cmdArgs[1];
                string username = cmdArgs[2];
                int points = int.Parse(cmdArgs[3]);
                
                if(contests.ContainsKey(contestName) && contests[contestName] == pass)
                {
                    if (!users.ContainsKey(username))
                    {
                        users[username] = new Dictionary<string, int>();
                    }
                    if(users[username].ContainsKey(contestName) 
                        && users[username][contestName] < points)
                    {
                        users[username][contestName] = points;
                    }
                    else if(!users[username].ContainsKey(contestName))
                    {
                        users[username][contestName] = points;
                    }
                }
            }

            
            ///Finding best user
            var bestUsers = users
                .OrderByDescending(kvp => kvp.Value.Values.Sum())
                .ToDictionary(x => x.Key, y => y.Value);

            Console.WriteLine($"Best candidate is {bestUsers.First().Key} with total " +
                $"{bestUsers.First().Value.Values.Sum()} points.");

            //////Ordering the users
            users = users
                .OrderBy(kvp => kvp.Key)
                .ToDictionary(x => x.Key, y => y.Value);

            Console.WriteLine("Ranking:");
            foreach (var user in users)
            {
                Console.WriteLine($"{user.Key}");
                foreach (var contest in user.Value.OrderByDescending(kvp => kvp.Value))
                {
                    Console.WriteLine($"#  {contest.Key} -> {contest.Value}");
                }
            }


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace MergingLists
{
    class Program
    {
        //static void Main(string[] args)
        //{
        //    List<int> first = Console.ReadLine().Split().Select(int.Parse).ToList();
        //    List<int> second = Console.ReadLine().Split().Select(int.Parse).ToList();
        //    List<int> result = new List<int>();
        //    result = MergeLists(first, second);
        //    Console.WriteLine(string.Join(" ", result));
        //}
        //static List<int> MergeLists(List<int> first, List<int> second)
        //{
        //    int count = Math.Max(first.Count, second.Count);
        //    List<int> newList = new List<int>();

        //    for (int i = 0; i < count; i++)
        //    {
        //        if( i < first.Count)
        //        {
        //            newList.Add(first[i]);
        //        }
        //        if (i < second.Count)
        //        {
        //            newList.Add(second[i]);
        //        }

        //    }
        //    return newList;

        //}
        static void Main(string[] args)
        {
            List<int> first = Console.ReadLine().Split().Select(int.Parse).ToList();
            List<int> second = Console.ReadLine().Split().Select(int.Parse).ToList();
            List<int> result = MergeLists(first, second);
            Console.WriteLine(string.Join(" ", result));
        }

        static List<int> MergeLists(List<int> first , List<int> second)
        {
            List<int> newList = new List<int>();
            int countNew = Math.Max(first.Count, second.Count);
            for (int i = 0; i < countNew; i++)
            {
                if(i < first.Count)
                {
                    newList.Add(first[i]);
                }
                if(i < second.Count)
                {
                    newList.Add(second[i]);
                }
            }
            return newList;
        }
    }
}
<file_sep>﻿using P05.BirthdayCelebrations.Contracts;
using System;
using System.Collections.Generic;
using System.Text;

namespace _05._Birthday_Celebrations.Models
{
    public class Pet : IBirthable
    {
        private string name;
        private string birthDate;

        public Pet(string name , string birthDate)
        {
            this.name = name;
            this.birthDate = birthDate;
        }

        public string GetBirth()
        {
            return this.birthDate;
        }
    }
}
<file_sep>﻿using System;

namespace _01._Smallest_of_Three_Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            int n1 = int.Parse(Console.ReadLine());
            int n2 = int.Parse(Console.ReadLine());
            int n3 = int.Parse(Console.ReadLine());
            Console.WriteLine(Min(n1, n2, n3));

        }
        static int Min(int n1 , int n2 , int n3)
        {
          //  int min = int.MaxValue;
            if(n1 < n2 && n1 < n3)
            {
                return n1;
            }
            else if(n2 < n1 && n2 < n3)
            {
                return n2;
            }
            else
            {
                return n3;
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04.WildFarm.Contracts
{
    public interface ISoundable
    {
        void ProduceSound();
    }
}
<file_sep>﻿using System;

namespace _07._Water_Overflow
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int capacity = 255;
            int sumQuantity = 0;
            for (int i = 0; i < n; i++)
            {
                int quantity = int.Parse(Console.ReadLine());
                if (quantity > capacity)
                {
                    Console.WriteLine("Insufficient capacity!");
                }
                else
                {
                    capacity -= quantity;
                    sumQuantity += quantity;
                }
            }
            Console.WriteLine(sumQuantity);
        }
    }
}
<file_sep>﻿using _05._Birthday_Celebrations.Models;
using P05.BirthdayCelebrations.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;

namespace P05.BirthdayCelebrations
{
    public class Engine
    {
        public void Run()
        {
           // List<string> allIds = new List<string>();
         //   List<IIdentifiable> citizens = new List<IIdentifiable>();
           // List<IIdentifiable> robots = new List<IIdentifiable>();
            
            List<IIdentifiable> robotsAndCitizens = new List<IIdentifiable>();
            List<IBirthable> birthables = new List<IBirthable>();


            string command;
            while((command = Console.ReadLine()) != "End")
            {
                string[] commandArgs = command
                    .Split()
                    .ToArray();

                if(commandArgs.Length == 5)
                {
                    string name = commandArgs[1];
                    int age = int.Parse(commandArgs[2]);
                    string id = commandArgs[3];
                    string birthdate = commandArgs[4];

                    Citizen citizen = new Citizen(name, age, id,birthdate);
                    //  citizens.Add(citizen);
                    robotsAndCitizens.Add(citizen);
                    birthables.Add(citizen);
                }
                else if(commandArgs[0] == "Robot")
                {
                    string model = commandArgs[1];
                    string id = commandArgs[2];

                    Robot robot = new Robot(model, id);
                    //robots.Add(robot);
                    robotsAndCitizens.Add(robot);
                    

                }
                else
                {
                    string name = commandArgs[1];
                    string birthdate = commandArgs[2];

                    Pet pet = new Pet(name, birthdate);

                    birthables.Add(pet);
                }

            }
            // string lastDigitFakeId = Console.ReadLine();

            // PrintFakeId(robotsAndCitizens, lastDigitFakeId);

            string lastDigitYear = Console.ReadLine();

            PrintListLastDigitThisYear(birthables, lastDigitYear);
           

        }
        private void PrintListLastDigitThisYear(List<IBirthable> birthables, string lastDigitYear)
        {
            foreach (IBirthable birthable in birthables)
            {
                string currBirthDate = birthable.GetBirth();
                if (currBirthDate.EndsWith(lastDigitYear))
                {
                    Console.WriteLine(currBirthDate);
                }
            }
        }



        private void PrintFakeId(List<IIdentifiable> robotsAndCitizens , string lastDigitFakeId)
        {
            foreach (IIdentifiable citizenOrRobot in robotsAndCitizens)
            {
                string currId = citizenOrRobot.GetId();
                if (currId.EndsWith(lastDigitFakeId))
                {
                    Console.WriteLine(currId);
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _01.CountSameValuesInArray
{
    class Program
    {
        static void Main(string[] args)
        {
            //-2.5 4 3 -2.5 -5.5 4 3 3 -2.5 3
            Dictionary<double, int> numbers = new Dictionary<double, int>();
            double[] arr = Console.ReadLine()
                .Split()
                .Select(double.Parse)
                .ToArray();

            for (int i = 0; i < arr.Length; i++)
            {
                double num = arr[i];
                if (!numbers.ContainsKey(num))
                {
                    numbers[num] = 0;
                }
                numbers[num]++;
            }

            foreach (var kvp in numbers)
            {
                Console.WriteLine($"{kvp.Key} - {kvp.Value} times");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace FilterByAge
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            var people = new Dictionary<string,int>();
            for (int i = 0; i < n; i++)
            {
                string[] cmdArgs = Console.ReadLine()
                    .Split(", ");

                string name = cmdArgs[0];
                int age = int.Parse(cmdArgs[1]);

                people.Add(name, age);

            }

            string filterText = Console.ReadLine();
            int ageToFilter = int.Parse(Console.ReadLine());




            if (filterText == "older")
            {
                people = people
                    .Where(kvp => kvp.Value > ageToFilter)
                    .ToDictionary(x => x.Key, y => y.Value);
            }
            else if(filterText == "younger")
            {
                people = people
                    .Where(kvp => kvp.Value < ageToFilter)
                    .ToDictionary(x => x.Key, y => y.Value);
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;

namespace _03._Periodic_Table
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var  periodicTable = new SortedSet<string>();

            for (int i = 0; i < n; i++)
            {
                string[] cmdArgs = Console.ReadLine()
                    .Split(" ", StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();
                for (int j = 0; j < cmdArgs.Length; j++)
                {
                    string currElem = cmdArgs[j];
                    periodicTable.Add(currElem);
                }
            }
            //periodicTable = periodicTable
            //    .OrderBy(x => x)
            //    .ToHashSet();

            Console.WriteLine(string.Join(" ", periodicTable));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace Hot_Potato
{
    class Program
    {
        static void Main(string[] args)
        {
            //var numbers = new Queue<int>();

            //numbers.Enqueue(1);
            //numbers.Enqueue(2);
            //numbers.Enqueue(3);

            var names = Console.ReadLine().Split();
            int toss = int.Parse(Console.ReadLine());

            var queue = new Queue<string>(names);

            int currentIndex = 1;

            while(queue.Count>1)
            {
                var currentName = queue.Dequeue();

                if(currentIndex == toss)
                {
                    Console.WriteLine($"Remove {currentName}");
                    currentIndex = 0;
                }
                else
                {
                    queue.Enqueue(currentName);
                }
                currentIndex++;
            }
            Console.WriteLine($"Last is {queue.Dequeue()}");

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _02.Change_List
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end")
                {
                    break;
                }
                string[] command = input.Split();
                switch (command[0])
                {
                    case "Delete":
                        int num = int.Parse(command[1]);
                        for (int i = 0; i < list.Count; i++)
                        {
                            if(list[i] == num)
                            {
                                list.Remove(list[i]);
                                i--;
                            }
                        }
                        break;
                    case "Insert":
                        int number = int.Parse(command[1]);
                        int index  = int.Parse(command[2]);
                        list.Insert(index, number);
                        break;
                }

            }
            Console.WriteLine(string.Join(" ", list));
        }
    }
}
<file_sep>﻿using System;

namespace CatWalking
{
    class Program
    {
        static void Main(string[] args)
        {
            int minutesADay = int.Parse(Console.ReadLine());
            int countRazhodki = int.Parse(Console.ReadLine());
            int CaloriesIntake = int.Parse(Console.ReadLine());

            int burnedCalories = countRazhodki * minutesADay * 5;
            if (burnedCalories >= (0.5 * CaloriesIntake))
            {
                Console.WriteLine($"Yes, the walk for your cat is enough. Burned calories per day: {burnedCalories}.");
            }
            else
            {
                Console.WriteLine($"No, the walk for your cat is not enough. Burned calories per day: {burnedCalories}.");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace SetsAndDictionaries
{
    class Program
    {
        static void Main(string[] args)
        {
            //Dictionary<int, int> dictionary = new Dictionary<int, int>();
            //dictionary.Add(1, 10);
            //dictionary.Add(2, 10);
            //foreach (var (key,value) in dictionary)
            //{
            //    Console.WriteLine(key + " "+ value);
            //}
            /////Other type of dcitionary
            ///
           var  townWithNeighbourHoods = new Dictionary<string, List<string>>();

            townWithNeighbourHoods.Add("Sofia", new List<string>());
            townWithNeighbourHoods["Sofia"].Add("Vitosha");
            townWithNeighbourHoods["Sofia"].Add("Gerena");

            foreach (var town in townWithNeighbourHoods)
            {
                Console.WriteLine(town.Key);
                foreach (var kvartal in town.Value)
                {
                    Console.WriteLine(kvartal);
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _02._Shopping_List
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = Console.ReadLine().Split('!').ToList();

            string input;
            while((input = Console.ReadLine()) != "Go Shopping!")
            {
                string[] command = input.Split().ToArray();
                if(command[0] == "Urgent")
                {
                    string itemToAdd = command[1];
                    if(!list.Any(item => item == itemToAdd))
                    {
                        list.Insert(0, itemToAdd);
                    }
                }
                else if(command[0] == "Unnecessary")
                {
                    string itemToRemove = command[1];
                    if(list.Any(item => item == itemToRemove))
                    {
                        list.Remove(itemToRemove);
                    }
                }
                else if(command[0] == "Correct")
                {
                    string oldItem = command[1];
                    string newItem = command[2];

                    if(list.Any(item => item == oldItem))
                    {
                        ////////////
                        int indexofOldItem = list.FindIndex(item => item == oldItem);
                        list[indexofOldItem] = newItem;
                    }
                }
                else if(command[0] == "Rearrange")
                {
                    string item = command[1];
                    if(list.Any(it => it == item))
                    {
                        list.Remove(item);
                        list.Add(item);
                    }
                }
            }

            Console.WriteLine(string.Join(", ", list));
        }
    }
}
<file_sep>﻿using P09.ExplicitInterfaces.Contracts;
using P09.ExplicitInterfaces.Models;
using System;
using System.Linq;

namespace P09.ExplicitInterfaces
{
    class StartUp
    {
        static void Main(string[] args)
        {
            string command;
            while((command = Console.ReadLine()) != "End")
            {
                string[] cmdArgs = command
                    .Split()
                    .ToArray();

                string name = cmdArgs[0];
                string country = cmdArgs[1];
                int age = int.Parse(cmdArgs[2]);

                Citizen citizen = new Citizen(name, country, age);
                IPerson person = citizen;
                IResident resident = citizen;

                Console.WriteLine(person.GetName());
                Console.WriteLine(resident.GetName());

            }
        }
    }
}
<file_sep>﻿using System;

namespace CinemaTIckets
{
    class Program
    {
        static void Main(string[] args)
        {
            float ticketsCount = 0;
            int standardCount = 0;
            int studentCount = 0;
            int kidCount = 0;

            int sumStandard = 0;
            int sumStudent = 0;
            int sumKid = 0;
            float sumTickets = 0;
            string command = Console.ReadLine();
            
            while(command != "Finish")
            {
                float freespace = float.Parse(Console.ReadLine());
                string typeTicket = Console.ReadLine();
                while(typeTicket != "End"&&typeTicket != "Finish")
                {   
                   
                    ticketsCount++;
                    if(typeTicket == "standard")
                    {
                        standardCount++;
                        
                    }
                    else if(typeTicket == "kid")
                    {
                        kidCount++;
                    }
                    else if(typeTicket == "student")
                    {
                        studentCount++;
                    }
                    typeTicket = Console.ReadLine();
                   // typeTicket = Console.ReadLine();
                    
                }
                if (typeTicket == "Finish")
                {
                    Console.WriteLine($"{command} - {(ticketsCount / freespace) * 100:F2}% full.");
                    sumTickets += ticketsCount;
                    sumStandard += standardCount;
                    sumKid += kidCount;
                    sumStudent += studentCount;
                    Console.WriteLine($"Total tickets: {sumTickets}");
                    Console.WriteLine($"{(sumStudent/sumTickets)*100:F2}% student tickets.");
                    Console.WriteLine($"{ (sumStandard/sumTickets)*100:F2}% standard tickets.");
                    Console.WriteLine($"{ (sumKid/sumTickets)*100:F2}% kids tickets.");
                    break;
                }
                else
                {
                    Console.WriteLine($"{command} - {(ticketsCount / freespace) * 100:F2}% full.");
                    sumTickets += ticketsCount;
                    sumStandard += standardCount;
                    sumKid += kidCount;
                    sumStudent += studentCount;
                    standardCount = 0;
                    kidCount = 0;
                    studentCount = 0;
                    ticketsCount = 0;
                    command = Console.ReadLine();
                }
            }
           

        }
    }
}
<file_sep>using ExtendedDatabase;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using NUnit.Framework;
using NUnit.Framework.Constraints;
using System;
using System.Threading;

namespace Tests
{
    public class ExtendedDatabaseTests
    {
        private Person gosho;
        private Person pesho;
        private ExtendedDatabase.ExtendedDatabase database;
        [SetUp]
        public void Setup()
        {
            gosho = new Person(447788556699, "Gosho");
            pesho = new Person(114560, "Pesho");
            database = new ExtendedDatabase.ExtendedDatabase(gosho, pesho);
        }

        [Test]
        public void ConstructorShouldInicialise()
        {
            
            var expected = new Person[] { gosho, pesho };
            var actual = expected;

            var database = new ExtendedDatabase.ExtendedDatabase(expected);

            Assert.That(actual, Is.EqualTo(expected));
        }
        [Test]
        public void AddShouldIncreaseDatabaseCount()
        {
            int expectedCount = 3;

            database.Add(new Person(21323, "Stamo"));
            int actualCount = this.database.Count;

            Assert.AreEqual(expectedCount, actualCount);

        }
        [Test]
        public void AddShouldThrowExceptionIfWeTryToAddMoreThan16People()
        {
            database = new ExtendedDatabase.ExtendedDatabase(gosho, pesho,
                new Person(1323, "tamo"), new Person(13233, "amo"), new Person(132123, "Ramo")
                , new Person(323, "tdmo"), new Person(21, "trmo"), new Person(23, "taqmo")
                , new Person(4, "Gom"), new Person(133, "Tom"), new Person(123, "Seamo")
                , new Person(512, "Feamo"),
                new Person(234, "tadfhjjgmo"), new Person(1315623, "taasdfasmo"), new Person(3455, "tamsdo")
                , new Person(2656, "ryttu"));

            Assert.Throws<InvalidOperationException>(() =>
            {
                database.Add(new Person(21323, "Stamo"));
            });

        }
        [Test]
        public void AddShouldThrowExceptionIfWeTryToAddAlreadyExistingUsername()
        {
            Assert.Throws<InvalidOperationException>(() =>
            {
                database.Add(new Person(23, "Gosho"));
            });
        }
        [Test]
        public void AddShouldThrowExceptionIfWeTryToAddAlreadyExistingId()
        {
            Assert.Throws<InvalidOperationException>(() =>
            {
                database.Add(new Person(447788556699, "Gone"));
            });
        }
        [Test]
        public void RemoveShouldDecreaseDatabaseCount()
        {
            int expectedCount = 1;

            database.Remove();

            int actualCount = database.Count;

            Assert.AreEqual(expectedCount, actualCount);
        }
        [Test]
        public void RemoveShouldThrowExceptionIfCountIsZero()
        {
            database = new ExtendedDatabase.ExtendedDatabase();

            Assert.Throws<InvalidOperationException>(() =>
            {
                database.Remove();
            });
        }
        [Test]
        public void FindByUsernameShouldThrowExceptionIfGivenStringIsNull()
        {
            Assert.Throws<ArgumentNullException>(() =>
            {
                database.FindByUsername("");
            });
        }
        [Test]
        public void FindByUsernameShouldThrowExceptionIfNoUserIsPresentByThisName()
        {
            Assert.Throws<InvalidOperationException>(() =>
            {
                database.FindByUsername("Stamo");
            });
        }
        [Test]
        public void FindByUSerNameShouldReturnValidUser()
        {
            var expected = pesho;

            var actual = database.FindByUsername("Pesho");

            Assert.AreEqual(expected, actual);
        }
        [Test]
        public void FindByUserNameShouldBeCaseSensitive()
        {
            Assert.Throws<InvalidOperationException>(() =>
            {
                database.FindByUsername("gosho");
            });
        }
        [Test]
        public void FindByIdShouldThrowExceptionIfNegativeIdIsGiven()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() =>
            {
                database.FindById(-10);
            });
        }
        [Test]
        public void FindByIdShouldThrowExceptionIfThereIsNotSuchId()
        {
            Assert.Throws<InvalidOperationException>(() =>
            {
                database.FindById(23324);
            });
        }
        [Test]
        public void FindByIdShouldReturnValidUser()
        {
            var expected = pesho;

            var actual = database.FindById(114560);

            Assert.AreEqual(expected, actual);
        }
        [Test]
        public void AddRangeThrowExceptionIfYouTryToMakeDatabaseWithMoreThan16People()
        {
            Assert.Throws<ArgumentException>(() =>
            {
                database = new ExtendedDatabase.ExtendedDatabase(gosho, pesho,
                new Person(1323, "tamo"), new Person(13233, "amo"), new Person(132123, "Ramo")
                , new Person(323, "tdmo"), new Person(21, "trmo"), new Person(23, "taqmo")
                , new Person(4, "Gom"), new Person(133, "Tom"), new Person(123, "Seamo")
                , new Person(512, "Feamo"),
                new Person(234, "tadfhjjgmo"), new Person(1315623, "taasdfasmo"), new Person(3455, "tamsdo")
                , new Person(2656, "ryttu"), new Person(256, "Joro"));
            });
        }

    }
}<file_sep>﻿using System;
using System.Linq;
using System.Runtime.CompilerServices;

namespace _02._Archery_Tournament
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] targets = Console.ReadLine().Split("|").Select(int.Parse).ToArray();
            int points = 0;
            while (true)
            {
                string inp = Console.ReadLine();
                if(inp == "Game over")
                {
                    break;
                }
                string[] command = inp.Split("@");               
                switch (command[0])
                {
                    case "Shoot Left":
                        int startIndex = int.Parse(command[1]);
                        int length = int.Parse(command[2]);
                        //int position = ;
                        if(startIndex >= 0 && startIndex < targets.Length)
                        {
                            
                                for (int i = 0; i < length; i++)
                                {
                                    startIndex--;
                                    if(startIndex == -1)
                                    {
                                        startIndex = targets.Length - 1;
                                    }
                                }     
                                if(targets[startIndex] >= 5)
                                {
                                     targets[startIndex] -= 5;
                                     points += 5;
                                }
                                 else if (targets[startIndex] > 0)
                                 {
                                    points += targets[startIndex];
                                    targets[startIndex] = 0;
                                 }


                        }
                        break;
                    case "Shoot Right":
                        int startInd = int.Parse(command[1]);
                        int len = int.Parse(command[2]);
                        //int position = ;
                        if (startInd >= 0 && startInd < targets.Length)
                        {

                            for (int i = 0; i < len; i++)
                            {
                                startInd++;
                                if (startInd == targets.Length)
                                {
                                    startInd = 0;
                                }
                            }
                            if (targets[startInd] >= 5)
                            {
                                targets[startInd] -= 5;
                                points += 5;
                            }
                            else if(targets[startInd] > 0)
                            {
                                points += targets[startInd];
                                targets[startInd] = 0;
                            }

                        }
                        break;
                    case "Reverse":
                        targets = targets.Reverse().ToArray();
                        break;

                }
                //if (inp == "Reverse")
                //{
                //        targets = targets.Reverse().ToArray();
                //}
            }
            Console.WriteLine(string.Join(" - ", targets));
           Console.WriteLine($"Iskren finished the archery tournament with {points} points!");
        }
    }
}
<file_sep>﻿using System;

namespace Objects
{
   
    class Program { 
        static void Main(string[] args)
        {
            Cars firstcar = new Cars();
            Cars secondcar = new Cars();
            firstcar.color = "blue";
            secondcar.color = "red";
            Console.WriteLine(firstcar.color);
            Console.WriteLine(secondcar.color);
            Console.WriteLine(firstcar.maxSpeed);
            firstcar.Suobsht();
            //Console.WriteLine("Hello World!");
        }
    }
}
<file_sep>﻿namespace Presents.Tests
{
    using NUnit.Framework;
    using System;
    using System.Diagnostics.Contracts;

    public class PresentsTests
    {
        private Bag bag;
        private Present present;
        [SetUp]
        public void SetUp()
        {
            bag = new Bag();
        }
        [Test]
        public void TestIfCTorPresentWorksCorrectly()
        {
            present = new Present("Joro", 2);

            Assert.AreEqual("Joro", present.Name);
            Assert.AreEqual(2, present.Magic);
        }

        [Test]
        public void CreateShouldAddPresentToTheBag()
        {
            int expectedCount = 1;
            present = new Present("Joro", 2);

            bag.Create(present);

            Assert.AreEqual(expectedCount, bag.GetPresents().Count);
        }
        [Test]
        public void CreateShouldThrowExceptionIfPresontIsNull()
        {
            present = null;

            Assert.Throws<ArgumentNullException>(() =>
            {
                bag.Create(present);
            });
        }
        [Test]
        public void CreateShouldThrowExcpetionIfThisPresentAlreadyExists()
        {
            present = new Present("Joro", 2);
            
            bag.Create(present);

            Assert.Throws<InvalidOperationException>(() =>
            {
                bag.Create(present);
            });
        }
        [Test]
        public void RemoveShouldDecreaseCount()
        {
            present = new Present("Joro", 2);

            bag.Create(present);
            bag.Remove(present);

            Assert.AreEqual(0, bag.GetPresents().Count);
            
        }
        [Test]
        public void GetPresentWithLeastMagicReturnsCorrectly()
        {
            present = new Present("Joro", 6);
            Present present1 = new Present("Vlado", 3);
            Present present2 = new Present("Gosho", 5);

            bag.Create(present);
            bag.Create(present1);
            bag.Create(present2);

            Present returnedPresent = bag.GetPresentWithLeastMagic();

            Assert.AreEqual(present1, returnedPresent);

        }
        [Test]
        public void GetPresentShouldReturnPresentWithGivenName()
        {
            present = new Present("Joro", 6);
            Present present1 = new Present("Vlado", 3);
            Present present2 = new Present("Gosho", 5);

            bag.Create(present);
            bag.Create(present1);
            bag.Create(present2);

            Present returnedPresent = bag.GetPresent("Vlado");

            Assert.AreEqual(present1,returnedPresent);
        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._Wizard_Poker
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = Console.ReadLine().Split(":").ToList();
            List<string> deck = new List<string>();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "Ready")
                {
                    break;
                }
                string[] command = input.Split();

                switch (command[0])
                {
                    case "Add":
                        if (list.Contains(command[1]))
                        {
                            deck.Add(command[1]);
                        }
                        else
                        {
                            Console.WriteLine("Card not found.");
                        }
                        break;
                    case "Insert":
                        string cardName = command[1];
                        int index = int.Parse(command[2]);
                        if (list.Contains(command[1]) && index >= 0 && index <= deck.Count)
                        {
                            deck.Insert(index, cardName);
                        }
                        else
                        {
                            Console.WriteLine("Error!");
                        }
                        break;
                    case "Remove":
                        if (deck.Contains(command[1]))
                        {
                            deck.Remove(command[1]);
                        }
                        else
                        {
                            Console.WriteLine("Card not found.");
                        }
                        break;
                    case "Swap":
                        string card1 = command[1];
                        string card2 = command[2];

                        int ind1 = deck.IndexOf(card1);
                        int ind2 = deck.IndexOf(card2);

                        string temp = deck[ind1];
                        deck[ind1] = deck[ind2];
                        deck[ind2] = temp;
                        break;
                    case "Shuffle":
                        deck.Reverse();
                        break;
                }
            }
            Console.WriteLine(string.Join(" ", deck));
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var input1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var input2 = Console.ReadLine().Split().Select(int.Parse).ToArray();


            Stack<int> materialsForCrafting = new Stack<int>(input1);
            Queue<int> magicLevelValues = new Queue<int>(input2);


            Dictionary<int, string> presentsMagicLevel = new Dictionary<int, string>
            {
                { 150,"Doll" },
                { 250,"Wooden train"},
                { 300,"Teddy bear" },
                { 400,"Bicycle"}
            };

            SortedDictionary<string, int> presentsMade = new SortedDictionary<string, int>();
                //DOll ->1
                //Bicycle ->2

            while(materialsForCrafting.Count > 0 && magicLevelValues.Count>0)
            {
                int magicLevel = materialsForCrafting.Peek() * magicLevelValues.Peek();
                
                if(presentsMagicLevel.ContainsKey(magicLevel))
                {
                    if (!presentsMade.ContainsKey(presentsMagicLevel[magicLevel]))
                    {
                        presentsMade.Add(presentsMagicLevel[magicLevel], 0);
                    }
                    presentsMade[presentsMagicLevel[magicLevel]]++;

                    materialsForCrafting.Pop();
                    magicLevelValues.Dequeue();
                }
                
                else
                {

                    if(magicLevel<0)
                    {
                        int sum = materialsForCrafting.Peek() + magicLevelValues.Peek();
                        materialsForCrafting.Pop();
                        magicLevelValues.Dequeue();
                        materialsForCrafting.Push(sum);
                    }
                    else if(magicLevel>0)
                    {
                        int material = materialsForCrafting.Peek() + 15;
                        materialsForCrafting.Pop();
                        magicLevelValues.Dequeue();
                        materialsForCrafting.Push(material);
                    }
                    else if(magicLevel==0)
                    {
                        if (materialsForCrafting.Peek() == 0)
                        {
                            materialsForCrafting.Pop();
                        }
                        if(magicLevelValues.Peek()==0)
                        {
                            magicLevelValues.Dequeue();
                        }
                    }
                }
            }

            if((presentsMade.ContainsKey("Doll") && presentsMade.ContainsKey("Wooden train"))
               || (presentsMade.ContainsKey("Teddy bear")&& presentsMade.ContainsKey("Bicycle")))
            {
                Console.WriteLine("The presents are crafted! Merry Christmas!");
            }
            else
            {
                Console.WriteLine("No presents this Christmas!");
            }

            if(materialsForCrafting.Count>0)
            {
                Console.WriteLine("Materials left:"+ string.Join(", ",materialsForCrafting));
            }
            if(magicLevelValues.Count>0)
            {
                Console.WriteLine("Magic left:" + string.Join(", ", magicLevelValues));
            }

            foreach (var present in presentsMade)
            {
                Console.WriteLine($"{present.Key}: {present.Value}");
            }


        //    10 - 5 20 15 -30 10
         //   40 60 10 4 10 0
       //          10 - 5 20 15 - 30 10
        //    40 60 10 4 10 0
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Models
{
    public class Owner
    {
        private List<Cat> cats;
        public Owner(string name)
        {
            this.Name = name;

            this.cats = new List<Cat>();
        }
        public string Name { get; }

        public void AddCat(string name , int age)
        {
            var cat = new Cat(name, age, this);/////We are giving as an argument the Owner Class with this keyword

            this.cats.Add(cat);
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _03._Rounding_Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] arr = Console.ReadLine().Split().Select(double.Parse).ToArray();
            int[] realarr = new int[arr.Length];
            for (int i = 0; i < realarr.Length; i++)
            {
                realarr[i] = (int)Math.Round(arr[i], MidpointRounding.AwayFromZero);

            }
            for (int i = 0; i < realarr.Length; i++)
            {
                    Console.WriteLine($"{arr[i]} => {realarr[i]}");
                  //Console.WriteLine(string.Join("=> ", realarr));
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _2.Loot
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> loot = Console.ReadLine().Split('|', StringSplitOptions.RemoveEmptyEntries).ToList();

            string input;
            while ((input = Console.ReadLine()) != "Yohoho!")
            {
                string[] command = input.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToArray();

                if(command[0] == "Loot")
                {
                    for (int i = 1; i < command.Length; i++)
                    {
                        string itemToAdd = command[i];
                        if (!loot.Contains(itemToAdd))
                        {
                            loot.Insert(0, itemToAdd);
                        }
                    }
                }
                else if(command[0] == "Drop")
                {
                    int index = int.Parse(command[1]);
                    if(index >= 0 && index < loot.Count)
                    {
                        string itemToRemove = loot[index];
                        loot.RemoveAt(index);
                        loot.Add(itemToRemove);
                    }
                }
                else if(command[0] == "Steal")
                {
                    int count = int.Parse(command[1]);
                    List<string> removedItems = new List<string>();
                    if(count >= loot.Count)
                    {
                        //loot.RemoveRange(0, loot.Count);
                        int length = loot.Count;
                        for (int i = 0; i < length; i++)
                        {
                            string item = loot[0];
                            removedItems.Add(item);
                            loot.RemoveAt(0);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < count; i++)
                        {
                            string item = loot[loot.Count - count + i];
                            removedItems.Add(item);
                            loot.RemoveAt(loot.Count - count + i);

                        }
                        //loot.RemoveRange(loot.Count - count, count);
                    }
                        Console.WriteLine(string.Join(", ", removedItems));
                }
            }
            if(loot.Count > 0)
            {
                double sumItemsLength = loot.Sum(i => i.Length);
                Console.WriteLine($"Average treasure gain: {(sumItemsLength/loot.Count):F2} pirate credits.");
            }
            else
            {
                Console.WriteLine("Failed treasure hunt.");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BakeryOpenning
{
    public class Bakery
    {
        private readonly ICollection<Employee> data;

        public string Name { get; set; }
        public int Capacity { get; set; }

        public Bakery(string name, int capacity)
        {
            this.data = new List<Employee>();
            this.Name = name;
            this.Capacity = capacity;
        }

        public void Add(Employee employee)
        {
            if(this.data.Count < this.Capacity)
            {
                this.data.Add(employee);
            }
        }
        public bool Remove(string name)
        {
            return this.data.Remove(this.data.FirstOrDefault(e => e.Name == name));
        }
        public Employee GetOldestEmployee()
        {
            return this.data.OrderByDescending(e => e.Age).First();
        }
        public Employee GetEmployee(string name)
        {
            return this.data.FirstOrDefault(e => e.Name == name);
        }

        public int Count { get => this.data.Count; }

        public string Report()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine($"Employees working at Bakery {this.Name}:");
            foreach(var em in this.data)
            {
                sb.AppendLine(em.ToString());
            }

            return sb.ToString().TrimEnd();
        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04.PizzaCalories.Ingredients
{
    public class Topping
    {
        private string toppingType;
        private double weight;
        private const double baseCaloriesPerGram = 2;

        public Topping(string toppingType , double weight)
        {
            this.ToppingType = toppingType;
            this.Weight = weight;
        }

        public string ToppingType
        {
            get
            {
                return this.toppingType;
            }
            private set
            {
                if(value.ToLower() != "meat" && value.ToLower() != "veggies" && value.ToLower() != "cheese" && value.ToLower() != "sauce")
                {
                    throw new ArgumentException($"Cannot place {value} on top of your pizza.");
                }
                this.toppingType = value;
            }
        }

        public double Weight
        {
            get
            {
                return this.weight;
            }
            private set
            {
                if(value < 1 || value > 50)
                {
                    throw new ArgumentException($"{this.ToppingType} weight should be in the range [1..50].");
                }
                this.weight = value;
            }
        }

        public double ToppingCalories()
        {
            double toppingModifier = FindModifier();

            return baseCaloriesPerGram * this.Weight * toppingModifier;
        }

        private double FindModifier()
        {
            double toppingTypeModifier = 0;
            switch (this.ToppingType.ToLower())
            {
                case "meat":
                    toppingTypeModifier = 1.2;
                    break;
                case "veggies":
                    toppingTypeModifier = 0.8;
                    break;
                case "cheese":
                    toppingTypeModifier = 1.1;
                    break;
                case "sauce":
                    toppingTypeModifier = 0.9;
                    break;
            }
            return toppingTypeModifier;
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _01
{
    class Program
    {
        static void Main(string[] args)
        {
            string username = Console.ReadLine();

            string input;
            while((input = Console.ReadLine()) != "Sign up")
            {
                string[] command = input.Split(" ", StringSplitOptions.RemoveEmptyEntries).ToArray();

                if(command[0] == "Case")
                {
                    if(command[1] == "lower")
                    {
                        username = username.ToLower();
                    }
                    else
                    {
                        username = username.ToUpper();
                    }

                    Console.WriteLine(username);
                }
                else if(command[0] == "Reverse")
                {
                    int startIndex = int.Parse(command[1]);
                    int endIndex = int.Parse(command[2]);

                    if(startIndex >= 0 && endIndex < username.Length)
                    {
                        string substr = username.Substring(startIndex, endIndex - startIndex + 1);
                        char[] subsArray = substr.ToCharArray();

                        Array.Reverse(subsArray);

                        string res = new string(subsArray);
                        Console.WriteLine(res);
                    }
                }
                else if(command[0] == "Cut")
                {
                    string subs = command[1];

                    if(username.Contains(subs))
                    {
                        int index = username.IndexOf(subs);
                        username = username.Remove(index, subs.Length);
                        Console.WriteLine(username);
                        ////////not sure
                    }
                    else
                    {
                        Console.WriteLine($"The word {username} doesn't contain {subs}.");
                    }
                }
                else if(command[0] == "Replace")
                {
                    char cToReplace = char.Parse(command[1]);
                    username = username.Replace(cToReplace, '*');

                    Console.WriteLine(username);
                }
                else
                {
                    char cToCheck = char.Parse(command[1]);
                    if(username.Contains(cToCheck))
                    {
                        Console.WriteLine("Valid");
                    }
                    else
                    {
                        Console.WriteLine($"Your username must contain {cToCheck}.");
                    }
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace _04._Sum_of_Chars
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int charSum = 0;
            while (n > 0)
            {
                char letter = char.Parse(Console.ReadLine());
                charSum += letter;
                n--;
            }
            Console.WriteLine($"The sum equals: {charSum}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _10._SoftUni_Exam_Results
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, int> results = new Dictionary<string, int>();

            Dictionary<string, int> countLanguages = new Dictionary<string, int>();

            while (true)
            {
                string inp = Console.ReadLine();
                if (inp == "exam finished")
                {
                    break;
                }
                string[] command = inp.Split("-");

                if(command[1] == "banned")
                {
                    string userName = command[0];
                    results.Remove(userName);
                }
                else
                {
                    string userName = command[0];
                    string language = command[1];
                    int points = int.Parse(command[2]);
                    if (!countLanguages.ContainsKey(language))
                    {
                        countLanguages[language] = 0;
                    }
                    if (!results.ContainsKey(userName))
                    {
                        results[userName] = 0;
                    }
                    if(points > results[userName])
                    {
                        results[userName] = points;
                    }                   
                    countLanguages[language]++;

                }
            }

            var sortedResults = results
                .OrderByDescending(kvp => kvp.Value)
                .ThenBy(kvp => kvp.Key)
                .ToDictionary( a => a.Key, b => b.Value);

            countLanguages = countLanguages
                .OrderByDescending(kvp => kvp.Value)
                .ThenBy(kvp => kvp.Key)
                .ToDictionary(a => a.Key, b => b.Value);

            Console.WriteLine("Results:");
            foreach (var kvp in sortedResults)
            {
                Console.WriteLine($"{kvp.Key} | {kvp.Value}");               
            }
            Console.WriteLine("Submissions:");
            foreach (var lang in countLanguages)
            {
                Console.WriteLine($"{lang.Key} - {lang.Value}");
            }
        }
    }
}
<file_sep>﻿using System;

namespace _05._Add_and_Subtract
{
    class Program
    {
        static void Main(string[] args)
        {
            int num1 = int.Parse(Console.ReadLine());
            int num2 = int.Parse(Console.ReadLine());
            int num3 = int.Parse(Console.ReadLine());
            int res = Sum(num1, num2);
            Console.WriteLine(Subtract(res, num3));


        }
        static int Sum(int n1,int n2)
        {
            return n1 + n2;
        }
        static int Subtract(int n1 , int n2)
        {
            return n1 - n2;
        }
    }
}
<file_sep>﻿using System;

namespace _08._Factorial_Division
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            double factoredA = Factor(a);
            double factoredB = Factor(b);
            double res = factoredA / factoredB;
            Console.WriteLine($"{res:F2}");

        }
        static double Factor(int a)
        {
            double res = 1;
            while (a > 0)
            {
                res *= a; 
                a--;
            }
            //Console.WriteLine(res);
            return res;
        }
    }
}
<file_sep>﻿using System;

namespace Volleyball
{
    class Program
    {
        static void Main(string[] args)
        {

            string typeYear = Console.ReadLine();
            double p = double.Parse(Console.ReadLine());
            double h = double.Parse(Console.ReadLine());

            double countPlayedGames = 0;
           // Console.WriteLine(p * 2 / 3);
            countPlayedGames = ((48 - h)* 0.75 + h  + (p * 2/3) );
           // Console.WriteLine(countPlayedGames);
            if(typeYear == "leap")
            {
                countPlayedGames = countPlayedGames + countPlayedGames * 0.15; 
            }
            Console.WriteLine(Math.Floor(countPlayedGames));

        }
    }
}
<file_sep>﻿using P08.CollectionHierarchy.Models;
using System;

namespace P08.CollectionHierarchy
{
    class StartUp
    {
        static void Main(string[] args)
        {
            AddCollection addCollection = new AddCollection();
            AddRemoveCollection addRemoveCollection = new AddRemoveCollection();
            MyList myList = new MyList();

            string[] firstLine = Console.ReadLine()
                .Split();

            for (int i = 0; i < firstLine.Length; i++)
            {
                string element = firstLine[i];

                addCollection.Add(element);
                addRemoveCollection.Add(element);
                myList.Add(element);
            }

            int countRemoveOperations = int.Parse(Console.ReadLine());
            for (int i = 0; i < countRemoveOperations; i++)
            {
                addRemoveCollection.Remove();
                myList.Remove();
            }

            Console.WriteLine(addCollection);
            Console.WriteLine(addRemoveCollection);
            Console.WriteLine(myList);

            addRemoveCollection.GetRemoved();
            myList.GetRemoved();
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P07.MilitaryElite.Exceptions
{
    public class InvalidMissionCompletionException : Exception
    {
        private const string DEF_MSG = "Mission already completed";
        public InvalidMissionCompletionException()
            :base(DEF_MSG)
        {
        }

        public InvalidMissionCompletionException(string message) : base(message)
        {
        }
    }
}
<file_sep>﻿using System;

namespace Scholarship
{
    class Program
    {
        static void Main(string[] args)
        {
            double income = double.Parse(Console.ReadLine());
            double averageSuccess = double.Parse(Console.ReadLine());
            double minimalSalary = double.Parse(Console.ReadLine());

            double scholarshipForResults = averageSuccess * 25 ;
            double socialScholarship = minimalSalary * 0.35;
            
            if(averageSuccess>=5.5 && income < minimalSalary )
            {
                if(scholarshipForResults > socialScholarship)
                {
                    Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(scholarshipForResults)} BGN");
                }
                else if(scholarshipForResults < socialScholarship)
                {
                    Console.WriteLine($"You get a Social scholarship {Math.Floor(socialScholarship)} BGN");
                }
                else
                {
                    Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(scholarshipForResults)} BGN");
                }
            }
            
            else if(averageSuccess >= 5.5)
            {   
                Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(scholarshipForResults)} BGN");
            }
            else if(income<minimalSalary && averageSuccess>4.5 )
            {
                Console.WriteLine($"You get a Social scholarship {Math.Floor(socialScholarship)} BGN");
            }
            else
            {
                Console.WriteLine("You cannot get a scholarship!");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Runtime.CompilerServices;

namespace Encapsulation
{
    class Program
    {
        static void Main(string[] args)
        {
            // var cat = new Cat("Luchko",3,"Ivan");

            // Console.WriteLine(cat.Details());


            ///////////////
            //var person = new PersonBuilder()
            //    .WithFirstName("Ivan")
            //    .WithAge(15)
            //    .Build();


            //var person = new Person();

            //person
            //    .RegisterForExam()
            //    .ParticipateInExam()
            //    .CalculateScore(); 

            //var name  = SetValue("Ivan")

            //}
            //private static void SetValue(string name)
            //{
            //   // name ??= throw new InvalidOperationException();
            //}

            var team = new Team("Top Team");

            team.AddPlayer(new Person("Ivan", "Ivanov", 50));
            team.AddPlayer(new Person("Ivan", "Peshov", 30));

            Console.WriteLine(team.FirstTeam.Count);
            Console.WriteLine(team.ReserveTeam.Count);

        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Messaging
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> log = new List<string>();
            string input;
            while((input = Console.ReadLine()) != "end")
            {
                string[] command = input.Split(' ',StringSplitOptions.RemoveEmptyEntries).ToArray();
                if(command[0] == "Chat")
                {
                    string message = command[1];
                    log.Add(message);
                }
                else if(command[0] == "Delete")
                {
                    string messToDelete = command[1];
                    if(log.Any(m => m == messToDelete))
                    {
                        log.Remove(messToDelete);
                    }
                }
                else if(command[0] == "Edit")
                {
                    string messToEdit = command[1];
                    string editedVers = command[2];

                    int index = log.FindIndex(i => i == messToEdit);
                    log[index] = editedVers;
                }
                else if(command[0] == "Pin")
                {
                    string message = command[1];
                    log.Remove(message);
                    log.Add(message);
                }
                else if(command[0] == "Spam")
                {
                    for (int i = 1; i < command.Length; i++)
                    {
                        log.Add(command[i]);
                    }
                }
            }

            Console.WriteLine(string.Join('\n', log));
        }
    }
}
<file_sep>﻿using System;

namespace _03._Elevator
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int capacity = int.Parse(Console.ReadLine());

            int courses = 0;
            while (n > 0)
            {
                n -= capacity;
                courses++;
            }
            Console.WriteLine(courses);
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _08.Letters_Change_Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] words = Console.ReadLine()
                .Split(" ", StringSplitOptions.RemoveEmptyEntries)
                .ToArray();

            double sum = 0;

            for (int i = 0; i < words.Length; i++)
            {
                sum = ProcessWord(words, sum, i);
            }
            Console.WriteLine($"{sum:F2}");
        }

        private static double ProcessWord(string[] words, double sum, int i)
        {
            double tempSum = 0;

            string currWord = words[i];
            char firstLetter = currWord[0];
            char lastLetter = currWord[currWord.Length - 1];
            ParseeNumberFromInput(currWord);

            double number = ParseeNumberFromInput(currWord);

            tempSum += number;
            int firstLetterPos = GetAlphabeticalPosByLetter(firstLetter);
            int lastLetterPos = GetAlphabeticalPosByLetter(lastLetter);



            if (char.IsUpper(firstLetter) && firstLetterPos > 0)
            {
                tempSum /= firstLetterPos;
            }
            else if (char.IsLower(firstLetter) && firstLetterPos > 0)
            {
                tempSum = number * firstLetterPos;
            }

            if (char.IsUpper(lastLetter) && lastLetterPos > 0)
            {
                tempSum -= lastLetterPos;
            }
            else if (char.IsLower(lastLetter) && lastLetterPos > 0)
            {
                tempSum += lastLetterPos;
            }
            sum += tempSum;
            return sum;
        }

        static int GetAlphabeticalPosByLetter(char letter)
        {
            int position = -1;
            if (char.IsLetter(letter))
            {
                if (char.IsUpper(letter))
                {
                    position = letter - 64;
                }
                else
                {
                    position = letter - 96;
                }
                
            }
            return position;

        }

        private static double ParseeNumberFromInput(string currWord)
        {
            char[] numberAsChar = currWord.Skip(1)
                .Take(currWord.Length - 2)
                .ToArray();

            string numberAsString = String.Join("", numberAsChar);

            double number = double.Parse(numberAsString);
            return number;
        }
        // static int 
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P06.SpeedRacing
{
    public class Car
    {
        public Car(string model,double fuelAmount,double fuelCons)
        {
            this.Model = model;
            this.FuelAmount = fuelAmount;
            this.FuelConsumptionPerKilometer = fuelCons;
        }
        public string Model { get; private set; }
        public double FuelAmount { get; private set; }

        public double FuelConsumptionPerKilometer { get; private set; }
        public double TravelledDistance { get; private set; }

        public void Drive(int kilometers)
        {
            double fuelNeeded = kilometers * this.FuelConsumptionPerKilometer;
            if(this.FuelAmount >= fuelNeeded)
            {
                this.FuelAmount -= fuelNeeded;
                this.TravelledDistance += kilometers;
            }
            else
            {
                Console.WriteLine("Insufficient fuel for the drive");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;

namespace _07._List_Manipulation_Advanced
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "end")
                {
                    break;
                }
                string[] command = input.Split();
                switch (command[0])
                {
                    case "Contains":
                        DoesContain(list, int.Parse(command[1]));
                        break;
                    case "PrintEven":
                        PrintEven(list);
                        break;
                    case "PrintOdd":
                        PrintOdd(list);
                        break;
                    case "GetSum":
                        int sum = GetSum(list);
                        Console.WriteLine(sum);
                        break;
                    case "Filter":
                        string condition = command[1];
                        int num = int.Parse(command[2]);
                        Filter(list, condition, num);
                        break;


                }
            }

        }
        static void DoesContain(List<int> list, int number)
        {
            if (list.Contains(number))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No such number");
            }
        }
        static void PrintEven(List<int> list)
        {
            List<int> evenList = new List<int>();
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] % 2 == 0)
                {
                    evenList.Add(list[i]);
                }
            }
            Console.WriteLine(string.Join(" ", evenList));
        }
        static void PrintOdd(List<int> list)
        {
            List<int> oddList = new List<int>();
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] % 2 != 0)
                {
                    oddList.Add(list[i]);
                }
            }
            Console.WriteLine(string.Join(" ", oddList));
        }
        static int GetSum(List<int> list)
        {
            return list.Sum();
        }
        static void Filter(List<int> list, string condtion, int num)
        {
            //List<int> filteredList = new List<int>();


            for (int i = 0; i < list.Count; i++)
            {
                switch (condtion)
                {
                    case "<":
                        if (list[i] >= num)
                        {
                            list.Remove(list[i]);
                            i--;
                        }
                        break;

                    case ">":
                        if (list[i] <= num)
                        {
                            list.Remove(list[i]);
                            i--;
                        }
                        break;
                    case ">=":
                        if (list[i] < num)
                        {
                            list.Remove(list[i]);
                            i--;
                        }
                        break;
                    case "<=":
                        if (list[i] > num)
                        {
                            list.Remove(list[i]);
                            i--;
                        }
                        break;
                }
            }

            Console.WriteLine(string.Join(" ", list));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04._BorderControl.Contracts
{
    public interface ICitizen
    {
        string Name { get; }
        int Age { get; }
        string Id { get; }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._P_rates
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, int> citiesGold = new Dictionary<string, int>();
            Dictionary<string, int> citiesPopulation = new Dictionary<string, int>();

            string input;
            while((input = Console.ReadLine()) != "Sail")
            {
                string[] currCity = input.Split("||").ToArray();
                string cityName = currCity[0];
                int population = int.Parse(currCity[1]);
                int gold = int.Parse(currCity[2]);
                if(!citiesGold.ContainsKey(cityName))
                {
                    citiesGold[cityName] = 0;
                    citiesPopulation[cityName] = 0;
                }
                citiesGold[cityName] += gold;
                citiesPopulation[cityName] += population;

            }

            string input2;
            while((input2 = Console.ReadLine()) != "End")
            {
                string[] task = input2.Split("=>").ToArray();

                if(task[0] == "Plunder")
                {
                    string townName = task[1];
                    int peopleToKill = int.Parse(task[2]);
                    int goldToSteal = int.Parse(task[3]);

                    citiesGold[townName] -= goldToSteal;
                    citiesPopulation[townName] -= peopleToKill;

                    Console.WriteLine($"{townName} plundered! {goldToSteal} gold stolen, {peopleToKill} citizens killed.");
                    
                    if(citiesPopulation[townName] <= 0 || citiesGold[townName] <= 0)
                    {
                        citiesGold.Remove(townName);
                        citiesPopulation.Remove(townName);
                        Console.WriteLine($"{townName} has been wiped off the map!");
                    }

                }
                else if(task[0] == "Prosper")
                {
                    string townName = task[1];
                    int goldIncrease = int.Parse(task[2]);

                    if(goldIncrease < 0)
                    {
                        Console.WriteLine("Gold added cannot be a negative number!");
                        continue;
                    }
                    citiesGold[townName] += goldIncrease;
                    Console.WriteLine($"{goldIncrease} gold added to the city treasury. {townName} now has {citiesGold[townName]} gold.");
                }
            }

            citiesGold = citiesGold
                .OrderByDescending(kvp => kvp.Value)
                .ThenBy(kvp => kvp.Key)
                .ToDictionary(a => a.Key, b => b.Value);

            if(citiesGold.Any())
            {
                Console.WriteLine($"Ahoy, Captain! There are {citiesGold.Count} wealthy settlements to go to:");
                foreach (string cityName in citiesGold.Keys)
                {
                    Console.WriteLine($"{cityName} -> Population: {citiesPopulation[cityName]} citizens, Gold: {citiesGold[cityName]} kg");
                }
            }
            else
            {
                Console.WriteLine("Ahoy, Captain! All targets have been plundered and destroyed!");
            }

        }
    }
}
<file_sep>﻿using System;

namespace HotelProject
{
    class Program
    {
        static void Main(string[] args)
        {
            string month = Console.ReadLine();
            int countDays = int.Parse(Console.ReadLine());

            double moneyStudio = 0;
            double moneyApartment = 0;
            switch(month)
            {
                case "May":
                case "October":
                    moneyStudio = countDays * 50;
                    moneyApartment = countDays * 65;

                    if(countDays > 14)
                    {
                        moneyStudio = moneyStudio - moneyStudio * 0.3;
                        moneyApartment = moneyApartment - moneyApartment * 0.1;
                    }
                    else if(countDays>7)
                    {
                        moneyStudio = moneyStudio - moneyStudio * 0.05;
                    }
                   
                    
                    break;
                case "June":
                case "September":
                    moneyStudio = countDays * 75.20;
                    moneyApartment = countDays * 68.70;

                    if(countDays > 14)
                    {
                        moneyStudio = moneyStudio - moneyStudio * 0.2;
                        moneyApartment = moneyApartment - moneyApartment * 0.1;
                    }
                    break;
                case "July":
                case "August":
                    moneyStudio = countDays * 76;
                    moneyApartment = countDays * 77;
                    if(countDays > 14)
                    {
                        moneyApartment = moneyApartment - moneyApartment * 0.1;
                    }
                    break;
            }
            Console.WriteLine($"Apartment: { moneyApartment:F2} lv.");
            Console.WriteLine($"Studio: {moneyStudio:F2} lv.");
          
        }
    }
}
<file_sep>﻿using System;
using System.Text;

namespace ex1
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            //StringBuilder sb = new StringBuilder();

            double totalPrice = 0;
            for (int i = 0; i < N; i++)
            {
                double pricePerCapsule = double.Parse(Console.ReadLine());
                int days = int.Parse(Console.ReadLine());
                int capsulesCount = int.Parse(Console.ReadLine());

                double currPrice = Math.Round(((days * capsulesCount) * pricePerCapsule),2);
                totalPrice += currPrice;

                Console.WriteLine($"The price for the coffee is: ${currPrice:F2}");
                //sb.AppendLine($"The price for the coffee is: ${Math.Round(currPrice,2):F2}");
            }
            //Console.WriteLine(sb.ToString().TrimEnd());
            Console.WriteLine($"Total: ${Math.Round(totalPrice,2):F2}");
        }
    }
}
<file_sep>﻿using System;
using System.Text;

namespace _01._Activation_Keys
{
    class Program
    {
        static void Main(string[] args)
        {
            string key = Console.ReadLine();

            while (true)
            {
                string input = Console.ReadLine();
                if(input == "Generate")
                {
                    break;
                }
                string[] command = input.Split(">>>");

                if(command[0] == "Contains")
                {
                    string sub = command[1];
                    if (key.Contains(sub))
                    {
                        Console.WriteLine($"{key} contains {sub}");
                    }
                    else
                    {
                        Console.WriteLine("Substring not found!");
                    }
                }
                else if(command[0] == "Flip")
                {
                    int startIndex = int.Parse(command[2]);
                    int endIndex = int.Parse(command[3]);
                    if (command[1] == "Upper")
                    {
                        //string sub = key.Substring(startIndex, endIndex)
                       // //key = sub.ToUpper();
                        StringBuilder sb = new StringBuilder();
                        for (int i = 0; i < key.Length; i++)
                        {
                            //key[i] = key[i].ToString().ToUpper();
                            if (i >= startIndex && i < endIndex)
                            {
                                sb.Append(key[i].ToString().ToUpper());
                            }
                            else
                            {
                                sb.Append(key[i]);
                            }
                                                     
                        }
                        key = sb.ToString();
                    }
                    else
                    {
                        StringBuilder sb = new StringBuilder();
                        for (int i = 0; i < key.Length; i++)
                        {
                            //key[i] = key[i].ToString().ToUpper();
                            if (i >= startIndex && i < endIndex)
                            {
                                sb.Append(key[i].ToString().ToLower());
                            }
                            else
                            {
                                sb.Append(key[i]);
                            }

                        }
                        key = sb.ToString();
                    }
                    Console.WriteLine(key);
                }
                else
                {
                    int startIndex = int.Parse(command[1]);
                    int endIndex = int.Parse(command[2]);
                    int count = endIndex - startIndex;
                    key = key.Remove(startIndex, count);
                    Console.WriteLine(key);
                }

            }
            Console.WriteLine($"Your activation key is: {key}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03.Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine()
                .Split(' ')
                .Select(int.Parse)
                .ToList();

            double average = list.Average();

            var modifiedList = new List<int>();
            foreach (var item in list)
            {
                if(item > average)
                {
                    modifiedList.Add(item);
                }
            }
            if (modifiedList.Any())
            {
                modifiedList = modifiedList
                    .OrderByDescending(x => x)
                    .Take(5)
                    .ToList();

                Console.WriteLine(string.Join(' ', modifiedList));
            }
            else
            {
                Console.WriteLine("No");
            }
            
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;

namespace _01.Even_Lines
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] charactersToReplace = { '-', ',', '.', '!', '?' };

            StreamReader streamReader = new StreamReader("text.txt");

            int counter = 0;
            while (!streamReader.EndOfStream)
            {
                string line = streamReader.ReadLine();

                if(line == null)
                {
                    break;
                }

                if(counter % 2 == 0)
                {
                    line = ReplaceAll(charactersToReplace, '@', line);

                    line = ReverseWordsInText(line);

                    Console.WriteLine(line);

                }

                counter++;
            }
        }
        static string ReplaceAll(char[] replace , char replacement, string str)
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < str.Length; i++)
            {
                char currSymbol = str[i];

                if (replace.Contains(currSymbol))
                {
                    sb.Append(replacement);
                }
                else
                {
                    sb.Append(currSymbol);
                }
            }
            return sb.ToString().TrimEnd();
        }
        static string ReverseWordsInText(string str)
        {
            StringBuilder sb = new StringBuilder();

            string[] words = str
                .Split()
                .ToArray();

            for (int i = 0; i < words.Length; i++)
            {
                sb.Append(words[words.Length - i - 1]);
                sb.Append(' ');
            }
            return sb.ToString().TrimEnd();
        }
    }
}
<file_sep>
namespace TestDemos.Test
{
    using System;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using TestApp;
    using Xunit;
    public class CalculatorTest
    {
        [Fact]
        public void SumShouldReturnCorrectResultWithTwoNumbers()
        {
            var calculator = new Calculator();

            var result = calculator.CalculateSum(1, 2);

            Assert.Equal(3, result);



            //if(result != 3)
            //{
            //    throw new InvalidOperationException
            //        ("SumShouldReturnCorrectResultWithTwoNumbers failed");
            //}
        }

        [Fact]
        public void SumShouldReturnCorrectResultWithManyNumbers()
        {
            var calculator = new Calculator();

            var result = calculator.CalculateSum(1, 2,3,4,5,6);

            //if (result != 21)
            //{
            //    throw new InvalidOperationException
            //        ("SumShouldReturnCorrectResultWithManyNumbers failed");
            //}

            Assert.Equal(21, result);
        }

        [Fact]
        public void SumShouldReturnCorrectResultWithNoNumbers()
        {
            var calculator = new Calculator();

            var result = calculator.CalculateSum();

            //if (result != 0)
            //{
            //    throw new InvalidOperationException
            //        ("SumShouldReturnCorrectResultWithNoNumbers failed");
            //}
            Assert.Equal(0, result);

        }
        [Fact]
        public void ProductShouldReturnCorrectResultWithTwoNumbers()
        {
            var calculator = new Calculator();

            var result = calculator.Product(2, 3);

            Assert.Equal(6, result);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._Product_Shop
{
    class Program
    {
        static void Main(string[] args)
        {
            var shops = new 
                Dictionary<string, Dictionary<string, double>>();

            string command;
            while ((command = Console.ReadLine()) != "Revision")
            {
                string[] cmdArgs = command
                    .Split(", ",StringSplitOptions.RemoveEmptyEntries);

                string shopName = cmdArgs[0];
                string productName = cmdArgs[1];
                double price = double.Parse(cmdArgs[2]);

                if (!shops.ContainsKey(shopName))
                {
                    shops[shopName] = new Dictionary<string, double>();                    
                }              
                if (!shops[shopName].ContainsKey(productName))
                {
                    shops[shopName][productName] = 0;
                }
                shops[shopName][productName] = price;
               // shops[shopName].Add(productName, price);
            }

            shops = shops
                .OrderBy(kvp => kvp.Key)
                .ToDictionary(x => x.Key, y => y.Value);

            foreach (var kvp in shops)
            {
                Console.WriteLine($"{kvp.Key}->");
                foreach (var product in kvp.Value)
                {
                    Console.WriteLine($"Product: {product.Key}, Price: {product.Value}");
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace HoneyHarvest
{
    class Program
    {
        static void Main(string[] args)
        {
            string typeFlower = Console.ReadLine();
            int countFlowers = int.Parse(Console.ReadLine());
            string season = Console.ReadLine();

            double result=0;

            if(season == "Spring")
            {
                switch (typeFlower)
                {
                    case "Sunflower":
                        result = countFlowers * 10;
                        break;
                    case "Daisy":
                        result = countFlowers * (12+12*0.1);
                        break;
                    case "Lavender":
                        result = countFlowers * 12;
                        break;
                    case "Mint":
                        result = countFlowers * (10+10*0.1);
                        break;
                }
              //  result += result * 0.1;

            }
            
            if(season == "Summer")
            {
                switch (typeFlower)
                {
                    case "Sunflower":                        
                    case "Daisy":                       
                    case "Lavender":
                        result = countFlowers * 8;
                        break;
                    case "Mint":
                        result = countFlowers * 12;
                        break;
                }
                result += result * 0.1;
            }
            
            if(season == "Autumn")
            {
              //  Console.WriteLine("AAAAA");
                switch (typeFlower)
                { //Console.WriteLine("AAAAA");
                    case "Sunflower":
                        result = countFlowers * 12;
                        //Console.WriteLine(result);
                        break;
                    case "Daisy":
                        result = countFlowers * 6;
                        break;
                    case "Lavender":
                        result = countFlowers * 6;
                        break;
                    case "Mint":
                        result = countFlowers * 6;
                        break;
                }
                result = result *0.95;
            }

            Console.WriteLine($"Total honey harvested: {result:F2}");

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DefiningClasses
{
    public class Family
    {
        public List<Person> members;

        public Family()
        {
            this.members = new List<Person>();
        }


      //  public IReadOnlyCollection<Person> People
       //     => (IReadOnlyCollection<Person>) this.people;

        public void AddMember(Person member)
        {
            this.members.Add(member);
        }
        public Person GetOldestMember()
        {
            return this.members.OrderByDescending(p => p.Age).First();
        }
        public void FilterMembersWithAgeLowerThanOrEqualThan30()
        {
            this.members = this.members
                .Where(m => m.Age > 30)
                .OrderBy(m => m.Name)
                .ToList();
        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace P01.DatingApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] malesInput = Console.ReadLine()
                .Split(' ',StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();
            int[] femalesInput = Console.ReadLine()
                .Split(' ',StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();

            Stack<int> males = new Stack<int>(malesInput);
            Queue<int> females = new Queue<int>(femalesInput);

            int succesfullMatches = 0;

            while(males.Any() && females.Any())
            {
                int currMale = males.Peek();
                int currFemale = females.Peek();

                if(currMale <= 0)
                {
                    males.Pop();
                    continue;
                }
                if(currFemale <= 0)
                {
                    females.Dequeue();
                    continue;
                }
                if(currMale % 25 == 0)
                {
                    males.Pop();
                    males.Pop();
                    continue;
                }
                if(currFemale % 25 == 0)
                {
                    females.Dequeue();
                    females.Dequeue();
                    continue;
                }
                if(currMale == currFemale)
                {
                    males.Pop();
                    females.Dequeue();
                    succesfullMatches++;
                }
                else
                {
                    females.Dequeue();
                    int decreasedMale = males.Pop() - 2;
                    males.Push(decreasedMale);
                }
            }


            Console.WriteLine($"Matches: {succesfullMatches}");
            if (males.Any())
            {
                Console.WriteLine($"Males left: {string.Join(", ",males)}");
            }
            else
            {
                Console.WriteLine("Males left: none");
            }
            if (females.Any())
            {
                Console.WriteLine($"Females left: {string.Join(", ", females)}");
            }
            else
            {
                Console.WriteLine("Females left: none");
            }


        }
    }
}
<file_sep>﻿using P04._BorderControl.Contracts;
using P04._BorderControl.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P04._BorderControl.Core
{
    public class Engine
    {
        public void Run()
        {
           // List<string> allIds = new List<string>();
         //   List<IIdentifiable> citizens = new List<IIdentifiable>();
           // List<IIdentifiable> robots = new List<IIdentifiable>();
            
            List<IIdentifiable> robotsAndCitizens = new List<IIdentifiable>();


            string command;
            while((command = Console.ReadLine()) != "End")
            {
                string[] commandArgs = command
                    .Split()
                    .ToArray();

                if(commandArgs.Length == 3)
                {
                    string name = commandArgs[0];
                    int age = int.Parse(commandArgs[1]);
                    string id = commandArgs[2];

                    Citizen citizen = new Citizen(name, age, id);
                    //  citizens.Add(citizen);
                    robotsAndCitizens.Add(citizen);
                }
                else if(commandArgs.Length == 2)
                {
                    string model = commandArgs[0];
                    string id = commandArgs[1];

                    Robot robot = new Robot(model, id);
                    //robots.Add(robot);
                    robotsAndCitizens.Add(robot);

                }

            }
            string lastDigitFakeId = Console.ReadLine();

            PrintFakeId(robotsAndCitizens, lastDigitFakeId);
           

        }
        private void PrintFakeId(List<IIdentifiable> robotsAndCitizens , string lastDigitFakeId)
        {
            foreach (IIdentifiable citizenOrRobot in robotsAndCitizens)
            {
                string currId = citizenOrRobot.GetId();
                if (currId.EndsWith(lastDigitFakeId))
                {
                    Console.WriteLine(currId);
                }
            }
        }
    }
}
<file_sep>﻿using NUnit.Framework;

[TestFixture]
public class DummyTests
{
    [Test]
    public void DummyShouldLoseHealth()
    {
        //Arrange  
        var dummy = new Dummy(100, 200);

        //Act
        dummy.TakeAttack(50);

        //Assert
        Assert.That(dummy.Health, Is.EqualTo(50));
    }
    [Test]
    public void DeadDummyShouldThrowExceptionIfAttacked()
    {
        //Arrange
        var dummy = new Dummy(0, 200);       

        //Assert
        Assert.That(() => dummy.TakeAttack(50),//Act
            Throws.InvalidOperationException.With.Message.EqualTo("Dummy is dead.")
        );
    }
    [Test]
    public void DeadDummyShouldGiveExperience()
    {
        //Arrange
        var dummy = new Dummy(0, 200);

        //Act
        var experience = dummy.GiveExperience();

        //Assert
        Assert.That(experience, Is.EqualTo(200));
    }
    [Test]
    public void DummyShouldNotGiveExperienceIfDead()
    {
        //Arrange
        var dummy = new Dummy(100, 200);

        //Assert
        Assert.That(() => dummy.GiveExperience(),//Act
            Throws.InvalidOperationException.With.Message.EqualTo("Target is not dead."));
    }
}
<file_sep>﻿using System;

namespace ClassConsrtuctors
{
    class Person
    {
        public string name;
        public Person()
        {
            name = "Gosho";
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Person first = new Person();
            // first.name = "Ivan";
            Console.WriteLine(first.name);
        }
    }
}
<file_sep>﻿using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int biscuitsADay = int.Parse(Console.ReadLine());
            int countWorkers = int.Parse(Console.ReadLine());
            
            int otherFactoryBiscuitsfor30Days = int.Parse(Console.ReadLine());

            int sumBiscuits = 0;
            for (int i = 1; i <= 30; i++)
            {
                if(i % 3 == 0)
                {
                   // sumBiscuits += countWorkers * (int)Math.Floor(biscuitsADay * 0.75);
                    sumBiscuits +=  (int)Math.Floor(countWorkers *biscuitsADay * 0.75);

                    //sumBiscuits += Math.Floor(countWorkers*biscuitsADay * 0.75);

                }
                else
                {
                    sumBiscuits += countWorkers * biscuitsADay;
                }
            }
            Console.WriteLine($"You have produced {sumBiscuits} biscuits for the past month.");

            if(sumBiscuits > otherFactoryBiscuitsfor30Days)
            {
                int diff = sumBiscuits - otherFactoryBiscuitsfor30Days;
                Console.WriteLine($"You produce {(double)diff / otherFactoryBiscuitsfor30Days * 100:F2} percent more biscuits.");
            }
            else
            {
                int diff = otherFactoryBiscuitsfor30Days - sumBiscuits;
                Console.WriteLine($"You produce {(double)diff / otherFactoryBiscuitsfor30Days * 100:F2} percent less biscuits.");
            }
        }
    }
}
<file_sep>﻿using P03.Telephony.Contracts;
using P03.Telephony.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P03.Telephony.Models
{
    public class StationaryPhone : ICallable
    {
        public StationaryPhone()
        {

        }
        public string Call(string number)
        {
            if(!number.All(ch => char.IsDigit(ch)))
            {
                throw new InvalidNumberException();
            }
            return $"Dialing... {number}";
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Team
{
    public class Team
    {

        
        public string Name { get; }
        public List<>
    }
}
<file_sep>﻿using System;

namespace CleverLily
{
    class Program
    {
        static void Main(string[] args)
        {
            int age = int.Parse(Console.ReadLine());
            double priceLaundry = double.Parse(Console.ReadLine());
            double priceDolls = double.Parse(Console.ReadLine());

            int countDolls = 0;
            double moneyEarned = 0;
            int countStealedMoney = 0;
            int savedMoney = 0;

            for(int i=1;i<=age;i++)
            {
                if(i % 2 == 0)
                {
                    savedMoney += 10;
                    moneyEarned += savedMoney;
                    countStealedMoney++;
                }
                else
                {
                    countDolls++;
                }
            }
            moneyEarned = moneyEarned + countDolls * priceDolls -countStealedMoney*1;
            if(moneyEarned >= priceLaundry)
            {
                Console.WriteLine($"Yes! {moneyEarned - priceLaundry:F2}");
            }
            else
            {
                Console.WriteLine($"No! {priceLaundry - moneyEarned:F2}");
            }

        }
    }
}
<file_sep>﻿using System;
using System.IO;

namespace Streams__Files_and_Directories___Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            //  FileStream stream = new FileStream("text.txt", FileMode.OpenOrCreate);
            //FileStream file = new FileStream(@"..\..\text.txt", FileMode.Open);

            //  FileStream file = new FileStream("text.txt", FileMode.Open); 

            //StreamWriter writer = new StreamWriter("result.txt");

            /////using gurantees that the stream will be closed after stopping the process
            //using (writer)
            //{
            //  //  writer.WriteLine("Test");
            //   // writer.Write("Another");
            //}

            //StreamReader reader = new StreamReader("text.txt");

            //string result = reader.ReadLine();

            //Console.WriteLine(result);


            ///// or other way
            //// using StreamWriter writer = new StreamWriter("result.txt");
            /////    writer.Write("Test");c
            ////    writer.Write("Another");
            /////   

            //FileStream stream2 = new FileStream("result.dat", FileMode.OpenOrCreate);

            ////using var writer2 = new BinaryWriter(stream2);

            ////writer2.Write(true);
            ////writer2.Write(false);
            ////writer2.Write(true);

            //using var reader2 = new BinaryReader(stream2);

            //var first = reader2.ReadBoolean();
            //var second = reader2.ReadBoolean();
            //var third = reader2.ReadBoolean();

            //Console.WriteLine(first);


            using var reader = new StreamReader("text.txt");
            using var writer = new StreamWriter("output.txt");

            int count = 1;

            while (true)
            {
                var line = reader.ReadLine();

                if (line == null)
                {
                    break;
                }

                var convertedLine = $"{count}.{line}";

                writer.WriteLine(convertedLine);

                count++;
            }
        }
    }
}
<file_sep>﻿using System;

namespace Train_the_Trainers
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            double sumAllGrades = 0;
            int countPresentations = 0;

            string command = Console.ReadLine();
            while(command != "Finish")
            {   
                double sum = 0;
                double avr = 0;
                for(int i=0;i<n;i++)
                {
                    double grade = double.Parse(Console.ReadLine());
                    sum += grade;
                    sumAllGrades += grade;
                    countPresentations++;
                }
                avr = sum / n;
                Console.WriteLine($"{command} - {avr:F2}.");



                command = Console.ReadLine();
            }
            Console.WriteLine($"Student's final assessment is {sumAllGrades/countPresentations:F2}.");
        }
    }
}
<file_sep>﻿using System;

namespace NumsFromOneTO10
{
    class Program
    {
        static void Main(string[] args)
        {
           /* Console.WriteLine(1);
            Console.WriteLine(2);
            Console.WriteLine(3);
            Console.WriteLine(4);
            Console.WriteLine(5);
            Console.WriteLine(6);
            Console.WriteLine(7);
            Console.WriteLine(8);
            Console.WriteLine(9);
            Console.WriteLine(10);
            */
            int  input = int.Parse(Console.ReadLine());
            Console.WriteLine(input);

            








        }
    }
}
<file_sep>﻿using System;

namespace _06._Middle_Characters
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            PrintMiddleCharacters(str);
        }

        static void PrintMiddleCharacters(string str)
        {
            if(str.Length % 2 == 0)
            {
                Console.WriteLine($"{str[(str.Length-1)/2]}{str[(str.Length - 1) / 2 + 1]}");
            }
            else
            {
                Console.WriteLine(str[(str.Length - 1) / 2]);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _04._Reverse_Array_of_Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            var items = Console.ReadLine().Split().ToArray();
            int length = items.Length;
            for (int i = 0; i <= length/2; i++,length--)
            {
                var old_el = items[i];
                items[i] = items[length - 1];
                items[length - 1] = old_el;
            }
            Console.WriteLine(string.Join(" ", items));
        }
    }
}
<file_sep>﻿using System;

namespace _02.Bee
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            char[,] field = new char[n, n];

            for (int i = 0; i < n; i++)
            {
                string row = Console.ReadLine();
                for (int j = 0; j < n; j++)
                {
                    field[i, j] = row[j];
                }
            }

            int beeRow = -1;
            int beeCol = -1;

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (field[i, j] == 'B')
                    {
                        beeRow = i;
                        beeCol = j;
                    }
                }
            }
            int count_pollinated = 0;
            bool isOut = false;
            string command;
            while (isOut != true)
            {
                if ((command = Console.ReadLine()) == "End")
                {
                    break;
                }
                if (command == "up")
                {
                    if (move_bee(n, "up", ref field, beeRow - 1, beeCol,
                        ref beeRow, ref beeCol, ref count_pollinated, ref isOut) == false)
                    {
                        continue;
                    }
                }
                else if (command == "down")
                {
                    if (move_bee(n, "down", ref field, beeRow + 1, beeCol,
                        ref beeRow, ref beeCol, ref count_pollinated, ref isOut) == false)
                    {
                        continue;
                    }
                }
                else if (command == "left")
                {
                    if (move_bee(n, "left", ref field, beeRow, beeCol - 1,
                        ref beeRow, ref beeCol, ref count_pollinated, ref isOut) == false)
                    {
                        continue;
                    }
                }
                else if (command == "right")
                {
                    if (move_bee(n, "right", ref field, beeRow, beeCol + 1,
                        ref beeRow, ref beeCol, ref count_pollinated, ref isOut) == false)
                    {
                        continue;
                    }
                }
                PrintField(n, field);
                Console.WriteLine();
            }

            if (isOut)
            {
                Console.WriteLine("The bee got lost!");
            }
            if (count_pollinated >= 5)
            {
                Console.WriteLine($"Great job, the bee managed to pollinate {count_pollinated} flowers!");
            }
            else
            {
                Console.WriteLine($"The bee couldn't pollinate the flowers, she needed {5 - count_pollinated} flowers more");
            }

            PrintField(n, field);
        }

        private static void PrintField(int n, char[,] field)
        {
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    Console.Write(field[i, j]);
                }
                Console.WriteLine();
            }
        }

        public static bool move_bee(int n, string command, ref char[,] field, int changedRow, int changedCol,
            ref int beeRow, ref int beeCow, ref int count_pollinated, ref bool isOut)
        {

            field[beeRow, beeCow] = '.';///no
            if (changedRow < 0 || changedRow == n || changedCol < 0 || changedCol == n)
            {
                isOut = true;
                return false;
            }

            if(field[changedRow, changedCol] == 'f')
            {
                count_pollinated++;
            }
            else if(field[changedRow, changedCol] == 'O')
            {
                field[changedRow, changedCol] = '.';
                if (command == "up")/// check if it is out
                {
                    move_bee(n, "up", ref field, changedRow - 1, changedCol, ref beeRow, ref beeCow, ref count_pollinated, ref isOut);
                }
                else if(command == "down")
                {
                    move_bee(n, "down", ref field, changedRow + 1, changedCol, ref beeRow, ref beeCow, ref count_pollinated, ref isOut);
                }
                else if(command == "left")
                {
                    move_bee(n, "left", ref field, changedRow, changedCol - 1, ref beeRow, ref beeCow, ref count_pollinated, ref isOut);
                }
                else
                {
                    move_bee(n, "right", ref field, changedRow, changedCol + 1, ref beeRow, ref beeCow, ref count_pollinated, ref isOut);
                }
            }
            else
            {
                //just move 
            }
            field[changedRow, changedCol] = 'B';
            beeRow = changedRow;
            beeCow = changedCol;

            return true;
        }
       
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _01.Reverse_Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            while(str != "end")
            {
                string reversed = "";
                for (int i = str.Length - 1; i >= 0; i--)
                {
                    reversed += str[i];
                }
                Console.WriteLine($"{str} = {reversed}");

                str = Console.ReadLine();
            }
        }
    }
}
<file_sep>using FightingArena;
using NUnit.Framework;
using System;

namespace Tests
{
    public class WarriorTests
    {
        private Warrior warrior;
        [SetUp]
        public void Setup()
        {
        }

        [Test]
        public void ConstructorShouldInicialise()
        {
            string name = "Vlado";
            int damage = 50;
            int health = 100;

            warrior = new Warrior(name, damage, health);

            Assert.AreEqual(name, warrior.Name);
            Assert.AreEqual(damage, warrior.Damage);
            Assert.AreEqual(health, warrior.HP);
        }
        //[TestCase(string str = Strin, 50, 100)]
        [TestCase("",50,100)]
        [TestCase("Vlado",0,100)]
        [TestCase("Vlado",-50,100)]
        [TestCase("Vlado",50,-100)]
        public void ConstructorShouldThrowExceptionIfGivenWrongArguments(string name,int damage,
            int hp)
        {
            Assert.Throws<ArgumentException>(() =>
            {
                warrior = new Warrior(name, damage, hp);
            });
        }
        [TestCase("Vlado", 50, 30)]
        [TestCase("Vlado", 50, 29)]
        public void AttackShouldThrowExceptionIfAttackersHpIsBelow30(string name, int damage,
            int hp)
        {
            warrior = new Warrior(name, damage, hp);
            Assert.Throws<InvalidOperationException>(() =>
            {
                warrior.Attack(new Warrior("Ivan", 10, 100));
            });
        }
        [TestCase("Toni", 50, 30)]
        [TestCase("Toni", 50, 29)]
        public void AttackShouldThrowExceptionIfTheattackedWarriorsHpIsBElow30(string name, int damage,
            int hp)
        {
            warrior = new Warrior("Vlado", 50, 100);
            Warrior attacked = new Warrior(name, damage, hp);

            Assert.Throws<InvalidOperationException>(() =>
            {
                warrior.Attack(attacked);
            });
        }
        [Test]
        public void AttackShouldThrowExceptionIfTheAttackedHaveMoreDamageThanTheAttacker()
        {
            warrior = new Warrior("Vlado", 50, 99);

            Assert.Throws<InvalidOperationException>(() =>
            {
                warrior.Attack(new Warrior("Toni", 100, 100));
            });
        }
        [Test]
        public void AttackShouldLowerTheirHealth()
        {
            warrior = new Warrior("Vlado", 50, 100);
            Warrior attacked = new Warrior("Toni", 50, 100);

            warrior.Attack(attacked);

            Assert.AreEqual(attacked.HP, 50);
            Assert.AreEqual(warrior.HP, 50);
        }
        [Test]
        public void AttackShouldLowerTheirHealth2()
        {
            warrior = new Warrior("Vlado", 50, 100);
            Warrior attacked = new Warrior("Toni", 50, 40);

            warrior.Attack(attacked);

            Assert.AreEqual(attacked.HP, 0);
            Assert.AreEqual(warrior.HP, 50);
        }
    }
}<file_sep>﻿using System;
using System.Linq;
using System.Windows.Markup;

namespace JaggedArrayModification
{
    class Program
    {
        static void Main(string[] args)
        {
            int rows = int.Parse(Console.ReadLine());

            int[][] array = new int[rows][];

            for (int row = 0; row < rows; row++)
            {
                int[] currentRow = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                array[row] = currentRow;

            }

            while(true)
            {
                string command = Console.ReadLine();

                if(command == "END")
                {
                    foreach(var currentRow in array)
                    {
                        Console.WriteLine(string.Join(" ", currentRow));
                    }
                    break;
                }
                string[] commandParts = command.Split();
                int row = int.Parse(commandParts[1]);
                int col = int.Parse(commandParts[2]);
                int value = int.Parse(commandParts[3]);
               
                if(row < 0 || row>= rows || col < 0 || col>= array[row].Length)
                {
                    Console.WriteLine("Invalid cordinates");
                }

                if(commandParts[0] == "add")
                {
                    array[row][col] += value;
                }
                else if(commandParts[0] == "substract")
                {
                    array[row][col] -= value;
                }
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace P04.PizzaCalories.Ingredients
{
    public class Dough
    {
        private string flourType;
        private string bakingTechnique;
        private double weight;
        private const double caloriesPerGram = 2;

        public Dough(string flourType, string bakingTechnique, double weight)
        {
            this.FlourType = flourType;
            this.BakingTechnique = bakingTechnique;
            this.Weight = weight;
        }
        public string FlourType
        {
            get
            {
                return this.flourType;
            }
            private set
            {
                if(value.ToLower() != "white" && value.ToLower() != "wholegrain")
                {
                    throw new ArgumentException("Invalid type of dough.");
                }
                this.flourType = value;
                
            }
        }
        public string BakingTechnique
        {
            get
            {
                return this.bakingTechnique;
            }
            private set
            {
                if (value.ToLower() != "crispy" && value.ToLower() != "chewy" && value.ToLower() != "homemade")
                {
                    throw new ArgumentException("Invalid type of dough.");
                }
                this.bakingTechnique = value;
            }
        }

        public double Weight
        {
            get
            {
                return this.weight;
            }
            private set
            {
                if(value < 1 || value > 200)
                {
                    throw new ArgumentException("Dough weight should be in the range [1..200].");
                }
                this.weight = value;
            }
        }
        public double DoughCalories()
        {
            double flourModifier = 0;
            double bakingModifier = 0;

            flourModifier = FindFlourModifier();
            bakingModifier = FindBakingModifier();

            return caloriesPerGram * this.Weight * flourModifier * bakingModifier;
        }

        private double FindFlourModifier()
        {
            double flourModifier = 0;
            if (this.FlourType.ToLower() == "white")
            {
                flourModifier = 1.5;
            }
            else if(this.FlourType.ToLower() == "wholegrain")
            {
                flourModifier = 1;
            }

            return flourModifier;
        }

        private double FindBakingModifier()
        {
            double bakingModifier;
            if (this.BakingTechnique.ToLower() == "crispy")
            {
                bakingModifier = 0.9;
            }
            else if (this.BakingTechnique.ToLower() == "chewy")
            {
                bakingModifier = 1.1;
            }
            else
            {
                bakingModifier = 1.0;
            }

            return bakingModifier;
        }
    }
}
<file_sep>﻿using System;
using System.Globalization;

namespace DayOfWeek
{
    class Program
    {
        static void Main(string[] args)
        {
            //18 - 04 - 2016
            string date = Console.ReadLine();

            DateTime dateTime = DateTime.ParseExact(date,"dd-MM-yyyy",CultureInfo.InvariantCulture);
            Console.WriteLine(dateTime.DayOfWeek);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._P_rates
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, int> citiesPopulation = new Dictionary<string, int>();
            Dictionary<string, int> citiesGold = new Dictionary<string, int>();

            while (true)
            {
                string input = Console.ReadLine();
                if(input == "Sail")
                {
                    break;
                }
                string[] command = input.Split("||");
                string city = command[0];
                int population = int.Parse(command[1]);
                int gold = int.Parse(command[2]);

                if (!citiesPopulation.ContainsKey(city))
                {
                    citiesPopulation[city] = 0;
                    citiesGold[city] = 0;
                }
                citiesPopulation[city] += population;
                citiesGold[city] += gold;
            }

            while (true)
            {
                string input = Console.ReadLine();
                if(input == "End")
                {
                    break;
                }
                string[] command = input.Split("=>");
                if(command[0] == "Plunder")
                {
                    string city = command[1];
                    int peopleKilled = int.Parse(command[2]);
                    int goldStolen = int.Parse(command[3]);

                    Console.WriteLine($"{city} plundered! {goldStolen} gold stolen, {peopleKilled} citizens killed.");
                    
                    if(citiesGold[city]-goldStolen > 0 && citiesPopulation[city] - peopleKilled > 0)
                    {
                        citiesGold[city] -= goldStolen;
                        citiesPopulation[city] -= peopleKilled;
                    }
                    else
                    {
                        citiesPopulation.Remove(city);
                        citiesGold.Remove(city);
                        Console.WriteLine($"{city} has been wiped off the map!");
                    }

                }
                else if(command[0] == "Prosper")
                {
                    string city = command[1];
                    int goldIncome = int.Parse(command[2]);
                    if(goldIncome < 0)
                    {
                        Console.WriteLine("Gold added cannot be a negative number!");
                    }
                    else
                    {
                        citiesGold[city] += goldIncome;
                        Console.WriteLine($"{goldIncome} gold added to the city treasury. {city} now has {citiesGold[city]} gold.");
                    }
                }
            }
            citiesGold = citiesGold
                .OrderByDescending(kvp => kvp.Value)
                .ThenBy(kvp => kvp.Key)
                .ToDictionary(a => a.Key, b => b.Value);
            if(citiesGold.Count > 0)
            {
                Console.WriteLine($"Ahoy, Captain! There are {citiesGold.Count} wealthy settlements to go to:");
                foreach (string city in citiesGold.Keys)
                {
                    Console.WriteLine($"{city} -> Population: {citiesPopulation[city]} citizens, Gold: {citiesGold[city]} kg");
                }
            }
            else
            {
                Console.WriteLine("Ahoy, Captain! All targets have been plundered and destroyed!");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace P04.OpinionPoll
{
    public class Program
    {
        static void Main(string[] args)
        {
            Family family = new Family();
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string[] personArgs = Console.ReadLine().Split();

                string name = personArgs[0];
                int age = int.Parse(personArgs[1]);

                Person person = new Person(name, age);
                family.AddMember(person);
            }

            //Person oldestPerson = family.GetOldestMember();
            ////Console.WriteLine(oldestPerson.ToString());
            //Console.WriteLine($"{oldestPerson.Name} {oldestPerson.Age}");

            var membersSorted = family.Members
                .Where(m => m.Age > 30)
                .OrderBy(m => m.Name)
                .ToList();
            foreach (var member in membersSorted)
            {
                Console.WriteLine($"{member.Name} - {member.Age}");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace List_of_Products
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = new List<string>();
            int n = int.Parse(Console.ReadLine());
            list = AddProductsAndSort(list, n);
            for (int i = 0; i < n ; i++)
            {
                Console.WriteLine($"{i + 1}.{list[i]}");
            }
        }
        static List<string> AddProductsAndSort(List<string> list, int n)
        {
            for (int i = 0; i < n; i++)
            {
                string product = Console.ReadLine();
                list.Add(product);
            }
            list.Sort();
            return list;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Models
{
    internal class Cat // internal - only for this project 
    {
        private int age;
        
        public Cat(string name,int age)
        {
            this.Name = name;
            this.age = age;
        }

        public Cat(string name , int age , Owner owner)
            :this(name,age)
        {
            this.Owner = owner;
        }

        public string Name { get; }

        public Owner Owner { get;}

        public string Details()
        {
            return $"{this.Name} - {this.age} - {this.Owner.Name}";
        }
    }
}
<file_sep>﻿using System;

namespace _08.Beer_Kegs
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            double maxVolume = double.MinValue;
            string maxModel = "";
            for (int i = 0; i < n; i++)
            {
                string model = Console.ReadLine();
                float radius = float.Parse(Console.ReadLine());
                int height = int.Parse(Console.ReadLine());
                double currVolume = Math.PI * Math.Pow(radius,2) * height;
                if (currVolume > maxVolume)
                {
                    maxVolume = currVolume;
                    maxModel = model;
                }
            }
            Console.WriteLine(maxModel);
        }
    }
}
<file_sep>﻿using P01.Vehicles.Models;
using P01.Vehicles.Models.Factorys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;

namespace P01.Vehicles.Core
{
    public class Engine
    {
        private VehicleFactory vehicleFactory ;

        public Engine()
        {
            vehicleFactory = new VehicleFactory();
        }

        public void Run()
        {
            Vehicle car = ProduceVehicle();
            Vehicle truck = ProduceVehicle();
            Vehicle bus = ProduceVehicle();

            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string[] cmdArgs = Console.ReadLine()
                    .Split()
                    .ToArray();

                try
                {
                    ProcessCommand(car, truck,bus, cmdArgs);
                }
                catch (InvalidOperationException ioe)
                {
                    Console.WriteLine(ioe.Message);
                }


            }

            //Console.WriteLine($"{car.FuelQuantity:F2}");
            //Console.WriteLine($"{truck.FuelQuantity:F2}");
            Console.WriteLine(car.ToString());
            Console.WriteLine(truck.ToString());
            Console.WriteLine(bus);



        }

        private static void ProcessCommand(Vehicle car, Vehicle truck,Vehicle bus, string[] cmdArgs)
        {
            string action = cmdArgs[0];
            string type = cmdArgs[1];
            if (action == "Drive")
            {

                double kilometers = double.Parse(cmdArgs[2]);
                if (type == "Car")
                {
                    Console.WriteLine(car.Drive(kilometers));
                }
                else if (type == "Truck")
                {
                    Console.WriteLine(truck.Drive(kilometers));
                }
                else if(type == "Bus")
                {
                    Console.WriteLine(bus.Drive(kilometers));
                }
            }
            else if (action == "Refuel")
            {
                double liters = double.Parse(cmdArgs[2]);
                if (type == "Car")
                {
                    car.Refuel(liters);
                }
                else if (type == "Truck")
                {
                    truck.Refuel(liters);
                }
                else if (type == "Bus")
                {
                    bus.Refuel(liters);
                }
                
            }
            else if(action == "DriveEmpty")
            {
                double kilometers = double.Parse(cmdArgs[2]);
                Console.WriteLine(bus.DriveEmpty(kilometers));
            }
        }

        private Vehicle ProduceVehicle()
        {
            string[] vehicleArgs = Console.ReadLine()
                                        .Split()
                                        .ToArray();
            string type = vehicleArgs[0];
            double fuelQuantity = double.Parse(vehicleArgs[1]);
            double fuelCons = double.Parse(vehicleArgs[2]);
            double tankCapacity = double.Parse(vehicleArgs[3]);

            Vehicle vehicle = vehicleFactory
                .ProduceVehicle(type, fuelQuantity, fuelCons,tankCapacity);
            return vehicle;
        }



    }
}
<file_sep>﻿using System;
using System.Linq;

namespace P01.ListyIterator
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] creationData = Console.ReadLine().Split();
            ListyIterator<string> collection;

            if(creationData.Length > 1)
            {
                collection = new ListyIterator<string>(creationData.Skip(1));
            }
            else
            {
                collection = new ListyIterator<string>();
            }

            string command;
            while((command = Console.ReadLine()) != "END")
            {
                if(command == "Move")
                {
                    Console.WriteLine(collection.Move());
                }
                else if(command == "HasNext")
                {
                    Console.WriteLine(collection.HasNext());
                }
                else if(command == "Print")
                {
                    try
                    {
                        collection.Print();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }

                }
                else if(command == "PrintAll")
                {
                    foreach (var item in collection)
                    {
                        Console.Write($"{item} ");
                    }
                    Console.WriteLine();
                }


            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ProductShop
{
    class Program
    {
        static void Main(string[] args)
        {
            var productShop = new Dictionary<string, Dictionary<string, double>>();

            string input = Console.ReadLine();
            while(input != "Revision")
            {
                string[] inputInfo = input
                    .Split(", ", StringSplitOptions.RemoveEmptyEntries);

                string shopName = inputInfo[0];
                string productName = inputInfo[1];
                double productPrice = double.Parse(inputInfo[2]);

                if(!productShop.ContainsKey(shopName))
                {
                    productShop.Add(shopName, new Dictionary<string, double>());
                }
                if(!productShop[shopName].ContainsKey(productName))
                {
                    productShop[shopName].Add(productName, 0);
                }
                productShop[shopName][productName] = productPrice;
                

                input = Console.ReadLine();
            }
            foreach (var (shopName,products) in productShop.OrderBy(x => x.Key))
            {
                Console.WriteLine($"{shopName}->");
                foreach (var currentProduct in products)
                {
                    Console.WriteLine($"Product:{currentProduct.Key},price:{currentProduct.Value:F1}");
                }
            }
        }

    }
}
<file_sep>﻿using System;

namespace fruitMarket
{
    class Program
    {
        static void Main(string[] args)
        {
            double cenaQgodi = double.Parse(Console.ReadLine());
            double brBananas = double.Parse(Console.ReadLine());
            double brOranges = double.Parse(Console.ReadLine());
            double brMalini = double.Parse(Console.ReadLine());
            double brQgodi = double.Parse(Console.ReadLine());

            double cenaMalini = cenaQgodi - cenaQgodi * 0.5;
            double cenaOranges = cenaMalini - cenaMalini * 0.4;
            double cenaBananas = cenaMalini - cenaMalini * 0.8;

            double KolkoPariTrqbvat = cenaQgodi * brQgodi + cenaMalini * brMalini + cenaOranges * brOranges + cenaBananas * brBananas;

            Console.WriteLine(KolkoPariTrqbvat);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Encapsulation
{
    public class PersonBuilder
    {
        private Person person;

        public PersonBuilder()
        {
            this.person = new Person();
        }
        public PersonBuilder WithFirstName(string firstName)
        {
            this.person.FirstName = firstName;
            return this;
        }

        public PersonBuilder WithLastName(string lastName)
        {
            this.person.LastName = lastName;
            return this;
        }
        public PersonBuilder WithAge(int  age)
        {
            this.person.Age = age;
            return this;
        }

        public Person Build()
        {
            return this.person;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace _02.RandomiseWords
{
    class Program
    {
        static void Main(string[] args)
        {
            Random random = new Random();
            string[] input = Console.ReadLine().Split();

            for (int i = 0; i < input.Length; i++)
            {
                int index = random.Next(0, input.Length);
                string temp = input[i];
                input[i] = input[index];
                input[index] = temp;
              //  Console.WriteLine(input[index]);
            }
            foreach (var item in input)
            {
                Console.WriteLine(item);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _02._Sets_of_Elements
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] cmdArgs = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();
            int n = cmdArgs[0];
            int m = cmdArgs[1];

            HashSet<int> set1 = new HashSet<int>();
            HashSet<int> set2 = new HashSet<int>();


            for (int i = 0; i < n; i++)
            {
                int num = int.Parse(Console.ReadLine());
                set1.Add(num);
            }
            for (int i = 0; i < m; i++)
            {
                int num = int.Parse(Console.ReadLine());
                set2.Add(num);
            }

            foreach (var num in set1)
            {
                if(set2.Any(n => n == num))
                {
                    Console.Write(num + " ");
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace _10._4TopNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            isTopNumber(n);
        }
        static void isTopNumber(int n)
        {
            for (int i = 1; i <= n; i++)
            {
                int sum = 0;
                int num = i;
                bool hasOddDigit = false;
                while (num > 0)
                {
                    sum += num % 10;
                    int digit = num % 10;
                    if(digit % 2 != 0)
                    {
                        hasOddDigit = true;
                    }
                    num /= 10;
                }
                if(sum % 8 == 0 && hasOddDigit)
                {
                    Console.WriteLine(i);
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace AreaOfFiqueres
{
    class Program
    {
        static void Main(string[] args)
        {
            string fiquare = Console.ReadLine();
            double result = 0;

            switch (fiquare)
            {
                case "square":
                    double side = double.Parse(Console.ReadLine());
                    result = side * side;
                    break;
                case "rectangle":
                    double length = double.Parse(Console.ReadLine());
                    double width = double.Parse(Console.ReadLine());
                    result = length * width;
                    break;
                case "circle":
                    double radius = double.Parse(Console.ReadLine());
                    result = radius * radius * Math.PI;
                    break;
                case "triangle":
                    double side1 = double.Parse(Console.ReadLine());
                    double side2 = double.Parse(Console.ReadLine());
                    result = (side1 * side2) / 2;
                    break;

            }
            Console.WriteLine($"{result:F3}");
        }
    }
}
<file_sep>﻿using System;

namespace _04.BeeHive_Population
{
    class Program
    {
        static void Main(string[] args)
        {
            double population = double.Parse(Console.ReadLine());
            int years = int.Parse(Console.ReadLine());

            for (int i = 1; i <= years; i++)
            {
                //Console.WriteLine($"Godini{i}");
                population = population + Math.Floor(population / 10) * 2 ;
              //  Console.WriteLine($"Izlupeni:{population}");
                if(i % 5 == 0)
                {
                    population -= Math.Floor(population / 50) * 5;
                   // Console.WriteLine($"Imigraciq:{population}");

                }

                population = population - 2 * Math.Floor(population / 20);
               // Console.WriteLine($"Umrqli:{population}");

            }

            Console.WriteLine($"Beehive population: {population}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TestDemos.UnitTest1
{
    using NUnit.Framework;
    using TestApp1;

    [TestFixture]
    public class BankAccountTests
    {
        [Test]
        public void CreatingBankAccountShouldSetInititalAccount()
        {
            var bankAccount = new BankAccount(2000);

            Assert.AreEqual(2000, bankAccount.Amount);

        }
    }
}
<file_sep>﻿using System;

namespace ArrWithMethods
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = { 10, 20, 30 };

            string[] tokens = Console.ReadLine().Split();
            string command = tokens[0];
            if(command == "add")
            {
                int num = int.Parse(tokens[1]);
                int[] result = AddElement(arr,num);
                Console.WriteLine(string.Join(" ", result));
            }
            

            //Add 10
            //Remove 
            //Rotate Left
            //Switch 1 2 
        }

        static int[] AddElement(int[] arr, int num)
        {
            int[] arrNew = new int[arr.Length + 1];
            Array.Copy(arr, arrNew,arr.Length);
            arrNew[arrNew.Length - 1] = num;
            return arrNew;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public class Ship : Vehicle
    {
        public int MaxDepth { get; set; }
        public override string VrumVrum()
        {
            return "Ship is floating";
        }
    }
}
<file_sep>﻿using System;

namespace MetricConverter
{
    class Program
    {
        static void Main(string[] args)
        {
            double number = double.Parse(Console.ReadLine());
            string unit = Console.ReadLine();
            string toConvertUnit = Console.ReadLine();

            if(unit == "mm" )
            {
                if(toConvertUnit == "cm" )
                {
                    number = number / 10;
                }
                else
                {
                    number = number / 1000;
                }
            }
            else if(unit =="cm")
            {
                if(toConvertUnit == "mm")
                {
                    number = number * 10;
                }
                else
                {
                    number = number / 100;
                }
            }
            else
            {
                if(toConvertUnit == "mm")
                {
                    number = number * 1000;
                }
                else
                {
                    number = number * 100;
                }
            }
            Console.WriteLine($"{number:F3}");
        }
    }
}
<file_sep>﻿using P04.WildFarm.Contracts;
using P04.WildFarm.Exceptions;
using System;
using System.Collections.Generic;
using System.Text;

namespace P04.WildFarm.Models
{
    public abstract class Animal : IAnimal,ISoundable
    {
        private string UneatableFoodMessage = "{0} does not eat {1}!";

        protected Animal(string name,double weight)
        {
            this.Name = name;
            this.Weight = weight;
        }
        public string Name { get; private set; }

        public double Weight { get; private set; }

        public int FoodEaten { get; private set; }
        public abstract double WeightMultiplier { get; }

        public abstract ICollection<Type> PrefferedFoods { get; }
        public void Feed(IFood food)
        {
            if (!this.PrefferedFoods.Contains(food.GetType()))
            {
                throw new UneatableFoodException(string
                    .Format(UneatableFoodMessage,this.GetType().Name,food.GetType().Name));
            }

            this.Weight += this.WeightMultiplier * food.Quantity;
            this.FoodEaten += food.Quantity;

        }

        public abstract void ProduceSound();

        public override string ToString()
        {
            return $"{this.GetType().Name} [{this.Name},";
        }



    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P03.ShoppingSpree.Common
{
    public static class GlobalConstants
    {
        public static string InvalidNameExceptionMessage = "Name cannot be empty";
        public static string InvalidMoneyException = "Money cannot be negative";
    }
}
<file_sep>﻿using System;

namespace Equal_Sums_Even_Odd_Position
{
    class Program
    {
        static void Main(string[] args)
        {
            int first = int.Parse(Console.ReadLine());
            int second = int.Parse(Console.ReadLine());

            for(int i=first;i<=second;i++)
            {
                string currentNum = i.ToString();
                int oddSum = 0;
                int evenSum = 0;
                for(int j=0;j<currentNum.Length;j++)
                {
                    int currDigit = int.Parse(currentNum[j].ToString());
                    if(j%2==0)
                    {
                        evenSum += currDigit;
                    }
                    else
                    {
                        oddSum += currDigit;
                    }
                }
                if(oddSum == evenSum)
                {
                    Console.Write(currentNum +" ");
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace NewHouse
{
    class Program
    {
        static void Main(string[] args)
        {
            string typeFlower = Console.ReadLine();
            int countFlowers = int.Parse(Console.ReadLine());
            int budget = int.Parse(Console.ReadLine());

            double moneyNeeded = 0.00;

            if (typeFlower == "Roses")
            {
                moneyNeeded = countFlowers * 5;
                if (countFlowers > 80)
                {
                    moneyNeeded = moneyNeeded - moneyNeeded * 0.1;
                }

            }
            else if (typeFlower == "Dahlias")
            {
                moneyNeeded = countFlowers * 3.80;
                if (countFlowers > 90)
                {
                    moneyNeeded = moneyNeeded - moneyNeeded * 0.15; 
                }
            }
            else if(typeFlower == "Tulips")
            {
                moneyNeeded = countFlowers * 2.80;
                if (countFlowers > 80)
                {
                    moneyNeeded = moneyNeeded - moneyNeeded * 0.15;
                }
//Console.WriteLine(moneyNeeded);
            }
            else if(typeFlower == "Narcissus")
            {
                moneyNeeded = countFlowers * 3;
                if (countFlowers < 120)
                {
                    moneyNeeded = moneyNeeded + moneyNeeded * 0.15; 
                }

            }
            else if(typeFlower == "Gladiolus")
            {
                moneyNeeded = countFlowers * 2.5;
                if (countFlowers < 80)
                {
                    moneyNeeded = moneyNeeded + moneyNeeded * 0.2;
                }

            }

            
            if(budget>=moneyNeeded)
            {
                Console.WriteLine($"Hey, you have a great garden with {countFlowers} {typeFlower} and {budget - moneyNeeded:F2} leva left.");
            }
            else
            {
                Console.WriteLine($"Not enough money, you need {moneyNeeded-budget:F2} leva more.");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace _3.WordCount
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, int> wordAndFrequency = new Dictionary<string, int>();
            string[] words = File.ReadAllText("../../../words.txt").Split();

            using (StreamReader reader = new StreamReader("../../../text.txt"))
            {
                string currentLine = reader.ReadLine();

                while (currentLine != null)
                {
                    string[] wordsInCurrentLine = currentLine.ToLower()
                    .Split(new[] { ' ', '.', ',', '-', '?', '!', ':', ';' }, StringSplitOptions.RemoveEmptyEntries);

                    foreach (var word in words)
                    {
                        foreach (var item in wordsInCurrentLine)
                        {
                            if (word == item)
                            {
                                if (wordAndFrequency.ContainsKey(item) == false)
                                {
                                    wordAndFrequency.Add(item, 0);
                                }
                                wordAndFrequency[item]++;
                            }
                        }
                    }
                    currentLine = reader.ReadLine();
                }
            }
            using (StreamWriter writer = new StreamWriter("../../../output.txt"))
            {
                foreach (var item in wordAndFrequency.OrderByDescending(x => x.Value))
                {
                    writer.WriteLine($"{item.Key} - {item.Value}");
                }
            }
        }
    }
}<file_sep>﻿using System;

namespace Cake
{
    class Program
    {
        static void Main(string[] args)
        {
            int width = int.Parse(Console.ReadLine());
            int lenght = int.Parse(Console.ReadLine());

            int size = width * lenght;
            int sum = 0;
            //bool iseaten = false;

            while(sum < size)
            {
                string command = Console.ReadLine();
                if(command == "STOP")
                {   
                    break;
                }
                int szcake = int.Parse(command);
                sum = sum + szcake;


            }
            if(sum>=size)
            {
                Console.WriteLine($"No more cake left! You need {sum - size} pieces more.");
            }
            else
            {
                Console.WriteLine($"{size-sum} pieces are left.");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cars
{
    public class Seat : Car
    {
        public Seat(string model,string color)
            :base(model,color)
        {
           
        }
        public override string Start()
        {
            return "Started";
        }

    }
}
<file_sep>﻿using System;

namespace _09._Padawan_Equipment
{
    class Program
    {
        static void Main(string[] args)
        {
            //double a= 23.34343543;
            //Console.WriteLine(Math.Round(a, 2));
            double ivanchoMoney = double.Parse(Console.ReadLine());
            int studentsCount = int.Parse(Console.ReadLine());
            double priceSabre = double.Parse(Console.ReadLine());
            double priceRobe = double.Parse(Console.ReadLine());
            double priceBelt = double.Parse(Console.ReadLine());

            double countSabres = studentsCount + studentsCount * 0.1;
            countSabres = Math.Ceiling(countSabres);
          //  Console.WriteLine($"Count sabres:{countSabres}");
            
            int freeBelts = studentsCount / 6;



            double countBelts = studentsCount - freeBelts;

       // Console.WriteLine($"Count belts:{countBelts}");
           // Console.WriteLine($"Count :{freeBelts}");

            double res = (countSabres * priceSabre) + (countBelts * priceBelt) + (studentsCount * priceRobe);

           // Console.WriteLine($"Resultat:{res}");


            if (res <= ivanchoMoney)
            {
                Console.WriteLine($"The money is enough - it would cost {res:F2}lv.");
            }
            else
            {
                Console.WriteLine($"Ivan Cho will need {res - ivanchoMoney:F2}lv more.");
            }
      //      Console.WriteLine(freeBelts);





        }
    }
}
<file_sep>﻿using PlayersAndMonsters.Wizards;
using System;

namespace PlayersAndMonsters
{
    public class StartUp
    {
        public static void Main(string[] args)
        {
            //SoulMaster sm = new SoulMaster("as", 300);
            //DarkWizard da = new DarkWizard("Gosho", 20);
            //Console.WriteLine(da.ToString());
            //Console.WriteLine(sm.ToString());
        }
    }
}<file_sep>﻿using P01.Vehicles.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace P01.Vehicles.Models.Factorys
{
    public class VehicleFactory
    {
        public Vehicle ProduceVehicle(string type , double fuelQty , double fuelCons , double tankCapacity)
        {
            Vehicle vehicle = null;
            if(type == "Car")
            {
                vehicle = new Car(fuelQty,fuelCons,tankCapacity);
            }
            else if(type == "Truck")
            {
                vehicle = new Truck(fuelQty, fuelCons,tankCapacity);
            }
            else if(type == "Bus")
            {
                vehicle = new Bus(fuelQty, fuelCons, tankCapacity);
            }

            if(vehicle == null)
            {
                throw new ArgumentException(ExceptionMessage
                    .InvalidTypeVehicleExceptionMessage);
            }

            return vehicle;
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

class Program
{
    static void Main()
    {
        //Console.ReadLine();
        //string[] bestDna = null;
        //int bestLen = -1;
        //int startIndex = -1;
        //int bestDnaSum = 0;
        //int bestSampleIndex = 0;

        //int currentSampleIndex = 0;

        //while (true)
        //{
        //    string input = Console.ReadLine();

        //    if (input == "Clone them!")
        //    {
        //        break;
        //    }

        //    string[] currentDna = input.Split('!', StringSplitOptions.RemoveEmptyEntries);
        //    int currentLen = 0;
        //    int currentBestLen = 0;
        //    int currentEndIndex = 0;

        //    for (int a = 0; a < currentDna.Length; a++)
        //    {
        //        if (currentDna[a] == "1")
        //        {
        //            currentLen++;
        //            if (currentLen > currentBestLen)
        //            {
        //                currentEndIndex = a;
        //                currentBestLen = currentLen;
        //            }
        //        }
        //        else
        //        {
        //            currentLen = 0;
        //        }
        //    }

        //    int currentStartIndex = currentEndIndex - currentBestLen + 1;

        //    bool isCurrentDnaBetter = false;
        //    int currentDnaSum = currentDna.Select(int.Parse).Sum();

        //    if (currentBestLen > bestLen)
        //    {
        //        isCurrentDnaBetter = true;
        //    }
        //    else if (currentBestLen == bestLen)
        //    {
        //        if (currentStartIndex < startIndex)
        //        {
        //            isCurrentDnaBetter = true;
        //        }
        //        else if (currentStartIndex == startIndex)
        //        {
        //            if (currentDnaSum > bestDnaSum)
        //            {
        //                isCurrentDnaBetter = true;
        //            }
        //        }
        //    }

        //    currentSampleIndex++;

        //    if (isCurrentDnaBetter)
        //    {
        //        bestDna = currentDna;
        //        bestLen = currentBestLen;
        //        startIndex = currentStartIndex;
        //        bestDnaSum = currentDnaSum;
        //        bestSampleIndex = currentSampleIndex;
        //    }
        //}

        //Console.WriteLine($"Best DNA sample {bestSampleIndex} with sum: {bestDnaSum}.");
        //Console.WriteLine(string.Join(' ', bestDna));



        Console.ReadLine();
        string[] bestDna = null;
        int bestLen = -1;
        int startIndex = -1;
        int bestDnaSum = 0;
        int bestSampleIndex = 0;
        int currentSampleIndex = 0;

        while (true)
        {
            string input = Console.ReadLine();
            if(input == "Clone them!")
            {
                break;
            }

            string[] currentDna = input.Split("!").ToArray();

            int currLen = 0;
            int currBestLen = 0;
            int currEndIndex = 0;
            for (int i = 0; i < currentDna.Length; i++)
            {
                if(currentDna[i] == "1")
                {
                    currLen++;
                    if(currLen > currBestLen)
                    {
                    currEndIndex = i;
                    currBestLen = currLen;
                    }
                }
                else
                {
                    currLen = 0;
                }
              
            }
            int currStartIndex = currEndIndex - currBestLen + 1;
            bool isCurrentBetter = false;

            int currSum = currentDna.Select(int.Parse).Sum();
            if(currBestLen > bestLen)
            {
                isCurrentBetter = true;

            }
            else if(currBestLen == bestLen)
            {
                if(currStartIndex < startIndex)
                {
                    isCurrentBetter = true;
                }
                else if(currSum > bestDnaSum)
                {
                    isCurrentBetter = true;
                }
            }

            currentSampleIndex++;
            if(isCurrentBetter)
            {
                bestDna = currentDna;
                bestDnaSum = currSum;
                startIndex = currStartIndex;
                bestLen = currBestLen;
                bestSampleIndex = currentSampleIndex;
            }

            


        }

        Console.WriteLine($"Best DNA sample {bestSampleIndex} with sum: {bestDnaSum}.");
        Console.WriteLine(string.Join(" ", bestDna));



















    }
}<file_sep>﻿using System;

namespace Vacation
{
    class Program
    {
        static void Main(string[] args)
        {
            double moneyNeeded = double.Parse(Console.ReadLine());
            double totalMoney = double.Parse(Console.ReadLine());
            int days = 0;
            int spendingCounter = 0;
            while(totalMoney < moneyNeeded && spendingCounter < 5)
            {
                string operation = Console.ReadLine();
                double num = double.Parse(Console.ReadLine());
                days++;

                if(operation == "spend")
                {
                    
                    totalMoney = totalMoney - num;
                    spendingCounter++;
                    if(totalMoney < 0)
                    {
                        totalMoney = 0;
                    }
                }
                else if(operation == "save")
                {
                    totalMoney = totalMoney + num;
                    spendingCounter = 0;
                }

            }
            if(spendingCounter == 5)
            {
                Console.WriteLine("You can't save the money.");
                Console.WriteLine($"{days}");
            }
            else
            {
                Console.WriteLine($"You saved the money for {days} days.");
            }
        }
    }
}
<file_sep>﻿using System;

namespace _05.Login
{
    class Program
    {
        static void Main(string[] args)
        {
            string username = Console.ReadLine();
            string password = "";
            int lenght = username.Length - 1;
            while (lenght >= 0)
            {
                password = <PASSWORD> + username[lenght];
                lenght--;
            }
            //Console.WriteLine(password);
            string command = Console.ReadLine();
            int counter = 0;
            bool isBanned = false;
            while(command != password)
            {
                if(counter+1 == 4)
                {
                    isBanned = true;
                    break;
                }
                Console.WriteLine("Incorrect password. Try again.");
              //  Console.WriteLine("Counter: {counter}");
                
                command = Console.ReadLine();
                counter++;
            }
            if (isBanned)
            {
                Console.WriteLine($"User {username} blocked!");
            }
            else
            {
                Console.WriteLine($"User {username} logged in.");
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _07._Append_Arrays
{
    class Program
    {
        static void Main(string[] args)
        {
            //1 2 3 |4 5 6 |  7  8
            // string[] input = Console.ReadLine().Split("|").ToArray();

            // Console.WriteLine(string.Join(" ",input));
            //Console.WriteLine(input[0]);
            //Console.WriteLine(input[1]);
            //Console.WriteLine(input[2]);


            //List<int> list = Console.ReadLine().Split("|").Select(int.Parse).ToList();

            List<string> input = Console.ReadLine().Split("|").Reverse().ToList();
            List<int> numbers = new List<int>();
            for (int i = 0; i < input.Count; i++)
            {
                numbers.AddRange(input[i].Split(" ", StringSplitOptions.RemoveEmptyEntries)
                    .Select(int.Parse)
                    .ToList());
            }
           // numbers.Sort();
            Console.WriteLine(string.Join(" ", numbers));

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._School_Library
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> shelf = Console.ReadLine().Split("&").ToList();

            while (true)
            {
                string input = Console.ReadLine();
                if (input == "Done")
                {
                    break;
                }
                string[] command = input.Split(" | ");

                switch (command[0])
                {
                    case "Add Book":
                        if (!shelf.Contains(command[1]))
                        {
                            shelf.Insert(0, command[1]);
                        }
                        break;
                    case "Take Book":
                        if (shelf.Contains(command[1]))
                        {
                            shelf.Remove(command[1]);
                        }
                        break;
                    case "Swap Books":
                        if (shelf.Contains(command[1]) && shelf.Contains(command[2]))
                        {
                            int ind1 = shelf.IndexOf(command[1]);
                            int ind2 = shelf.IndexOf(command[2]);

                            string temp = shelf[ind1];
                            shelf[ind1] = shelf[ind2];
                            shelf[ind2] = temp;
                        }
                        break;
                    case "Insert Book":
                        shelf.Add(command[1]);
                        break;
                    case "Check Book":
                        int index = int.Parse(command[1]);
                        if (index >= 0 && index < shelf.Count)
                        {
                            Console.WriteLine(shelf[index]);
                        }
                        break;

                }
            }
            Console.WriteLine(string.Join(", ", shelf));
        }
    }
}
<file_sep>﻿using System;

namespace _02.Bee_2_
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            char[,] field = new char[n, n];

            for (int i = 0; i < n; i++)
            {
                string row = Console.ReadLine();
                for (int j = 0; j < n; j++)
                {
                    field[i, j] = row[j];
                }
            }

            int beeRow = -1;
            int beeCol = -1;

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (field[i, j] == 'B')
                    {
                        beeRow = i;
                        beeCol = j;
                    }
                }
            }
            int countflowers = 0;
            string command;
            while((command = Console.ReadLine()) != "End")
            {
                field[beeRow, beeCol] = '.';
                beeRow = MoveX(beeRow, command);
                beeCol = MoveY(beeCol, command);

                if (beeRow < 0 || beeRow >= n || beeCol < 0 || beeCol >= n)
                {
                    Console.WriteLine("The bee got lost!");
                    break;
                }

                if(field[beeRow, beeCol] == 'f')
                {
                    countflowers++;
                }
                else if(field[beeRow, beeCol] == 'O')
                {
                    field[beeRow, beeCol] = '.';
                    beeRow = MoveX(beeRow, command);
                    beeCol = MoveY(beeCol, command);
                    if (field[beeRow, beeCol] == 'f')
                    {
                        countflowers++;
                    }
                    if (beeRow < 0 || beeRow >= n || beeCol < 0 || beeCol >= n)
                    {
                        Console.WriteLine("The bee got lost!");
                        break;
                    }
                }

                field[beeRow, beeCol] = 'B';
            }
            if(countflowers < 5)
            {
                Console.WriteLine($"The bee couldn't pollinate the flowers, she needed {5 - countflowers} flowers more");
            }
            else
            {
                Console.WriteLine($"Great job, the bee managed to pollinate {countflowers} flowers!");
            }

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    Console.Write(field[i, j]);
                }
                Console.WriteLine();
            }

        }

        private static int MoveX(int beeRow, string command)
        {
            if(command == "up")
            {
                beeRow -= 1;
            }
            else if(command == "down")
            {
                beeRow += 1;
            }

            return beeRow;
        }
        private static int MoveY(int beeCol, string command)
        {
            if (command == "left")
            {
                beeCol -= 1;
            }
            else if (command == "right")
            {
                beeCol += 1;
            }

            return beeCol;
        }
    }
}
<file_sep>﻿using System;

namespace _02._Selling
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            char[,] field = new char[n, n];

            for (int i = 0; i < n; i++)
            {
                string row = Console.ReadLine();
                for (int j = 0; j < n; j++)
                {
                    field[i, j] = row[j];
                }
            }

            int yourRow = -1;
            int yourCol = -1;

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (field[i, j] == 'S')
                    {
                        yourRow = i;
                        yourCol = j;
                    }
                }
            }
            int collectedMoney = 0;
            while(collectedMoney < 50)
            {
                string command = Console.ReadLine();
                field[yourRow, yourCol] = '-';
                yourRow = MoveX(yourRow, command);
                yourCol = MoveY(yourCol, command);

                if (yourRow < 0 || yourRow >= n || yourCol < 0 || yourCol >= n)
                {
                    Console.WriteLine("Bad news, you are out of the bakery.");
                    break;
                }

                if(field[yourRow, yourCol] == 'O')
                {
                    field[yourRow, yourCol] = '-';
                    for (int i = 0; i < n; i++)
                    {
                        for (int j = 0; j < n; j++)
                        {
                            if (field[i, j] == 'O')
                            {
                                yourRow = i;
                                yourCol = j;
                            }
                        }
                    }
                }
                else if(field[yourRow, yourCol] == '-')
                {

                }
                else
                {
                    collectedMoney += int.Parse(field[yourRow, yourCol].ToString());
                }
                field[yourRow, yourCol] = 'S';
               
            }

            if(collectedMoney >= 50)
            {
                Console.WriteLine("Good news! You succeeded in collecting enough money!");
            }
            Console.WriteLine($"Money: {collectedMoney}");

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    Console.Write(field[i, j]);
                }
                Console.WriteLine();
            }
        }
        private static int MoveX(int beeRow, string command)
        {
            if (command == "up")
            {
                beeRow -= 1;
            }
            else if (command == "down")
            {
                beeRow += 1;
            }

            return beeRow;
        }
        private static int MoveY(int beeCol, string command)
        {
            if (command == "left")
            {
                beeCol -= 1;
            }
            else if (command == "right")
            {
                beeCol += 1;
            }

            return beeCol;
        }
    }
}
<file_sep>﻿using System;

namespace P08.Threeuple
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] personInfo = Console.ReadLine()
                .Split();
            string fullName = $"{personInfo[0]} {personInfo[1]}";
            string address = personInfo[2];
            string town = personInfo[3];

            string[] nameAndBeer = Console.ReadLine().Split();
            string name = nameAndBeer[0];
            int beerAmount = int.Parse(nameAndBeer[1]);
            bool isDrunk = nameAndBeer[2] == "drunk" ? true : false;

            string[] bankArgs = Console.ReadLine().Split();
            string realName = bankArgs[0];
            double accountBalance = double.Parse(bankArgs[1]);
            string bankName = bankArgs[2];

            Threeuple<string, string, string> firstThreeuple = new
                Threeuple<string, string, string>(fullName, address, town);
            Threeuple<string, int, bool> secondThreeuple = new
                Threeuple<string, int, bool>(name, beerAmount, isDrunk);
            Threeuple<string, double, string> thirdThreeuple = new
                Threeuple<string, double, string>(realName, accountBalance, bankName);

            Console.WriteLine(firstThreeuple);
            Console.WriteLine(secondThreeuple);
            Console.WriteLine(thirdThreeuple);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public class Motorcycle : Vehicle
    {
        public int MaxSpeed { get; set; }
    }
}
<file_sep>﻿using System;

namespace Inheritance
{
    class Program
    {
        static void Main(string[] args)
        {
            var student = new Student();

            var doctor = new Doctor();

            
            
        }
    }
}
<file_sep>﻿using System;
using System.Numerics;

namespace _09._Spice_Must_Flow
{
    class Program
    {
        static void Main(string[] args)
        {
            BigInteger startingYield = BigInteger.Parse(Console.ReadLine());
            BigInteger days = 0;
            BigInteger sum = 0;

            if (startingYield < 100)
            {
                Console.WriteLine(days);
                Console.WriteLine(sum);

            }
            else
            {
                while (startingYield >= 100)
                {
                    // days++;



                    sum = sum + startingYield - 26;
                    startingYield -= 10;
                    days++;
                } 
            sum -= 26;
            Console.WriteLine(days);
            Console.WriteLine(sum);
            }
            
          
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime;

namespace _04._List_Operations
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "End")
                {
                    break;
                }
                string[] command = input.Split();

                switch (command[0])
                {
                    case "Add":
                        list.Add(int.Parse(command[1]));
                        break;
                    case "Insert":
                        int num = int.Parse(command[1]);
                        int index = int.Parse(command[2]);
                        if (index >= 0 && index < list.Count)
                        {
                            list.Insert(index, num);
                           
                        }
                        else
                        { 
                            Console.WriteLine("Invalid index");
                           
                        }
                        break;
                    case "Remove":
                        if (int.Parse(command[1]) < 0 || int.Parse(command[1]) >= list.Count)
                        {
                            Console.WriteLine("Invalid index");
                        }
                        else
                        {
                            list.RemoveAt(int.Parse(command[1]));
                        }
                        break;
                    case "Shift":
                        int times = int.Parse(command[2]);
                        if (command[1] == "left")
                        {
                            
                            for (int i = 0; i < times; i++)
                            {
                                list.Add(list[0]);
                                list.RemoveAt(0);
                            }
                        }
                        else if(command[1] == "right")
                        {
                            for (int i = 0; i < times; i++)
                            {
                                list.Insert(0, list[list.Count-1]);
                                list.RemoveAt(list.Count - 1);
                            }
                        }
                        break;
                }
            }
            Console.WriteLine(string.Join(" ", list));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04.WildFarm.Contracts
{
    public interface IAnimal
    {
        string Name { get; }
        double Weight { get; }
        int FoodEaten { get; }

        void Feed(IFood food);
        void ProduceSound();
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;

namespace P09.PokemonTrainer
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Trainer> trainers = new List<Trainer>();
            string command;
            while((command = Console.ReadLine()) != "Tournament")
            {
                string[] cmdArgs = command
                                .Split(' ',StringSplitOptions.RemoveEmptyEntries);

                string trainerName = cmdArgs[0];
                string pokemonName = cmdArgs[1];
                string pokemonElement = cmdArgs[2];
                int pokemonHealth = int.Parse(cmdArgs[3]);
               
                Pokemon pokemon = new Pokemon(pokemonName, pokemonElement, pokemonHealth);
                if(!trainers.Any(t => t.Name == trainerName))
                {
                    Trainer trainer = new Trainer(trainerName);
                    trainer.Pokemons.Add(pokemon);
                    trainers.Add(trainer);
                }
                else
                {
                    Trainer trainer = trainers.Find(t => t.Name == trainerName);
                    trainer.Pokemons.Add(pokemon);
                }

            }
            string command2;
            while((command2 = Console.ReadLine()) != "End")
            {
                string wantedElement = command2;
                foreach (var trainer in trainers)
                {
                    if(trainer.Pokemons.Any(p => p.Element == wantedElement))
                    {
                        trainer.NumberOfBadges++;
                    }
                    else
                    {
                        DecreasePokemonsHealthBy10(trainer);
                        //trainer.Pokemons.Select(p => p.Health - 10);
                        trainer.Pokemons.RemoveAll(p => p.Health <= 0);
                    }
                }
            }

            trainers = trainers
                .OrderByDescending(t => t.NumberOfBadges)
                .ToList();

            foreach (var trainer in trainers)
            {
                Console.WriteLine($"{trainer.Name} {trainer.NumberOfBadges}" +
                    $" {trainer.Pokemons.Count}");
            }



        }

        private static void DecreasePokemonsHealthBy10(Trainer trainer)
        {
            foreach (var pokemon in trainer.Pokemons)
            {
                pokemon.Health -= 10;
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
namespace MatchingBrackets
{
    class Program
    {
        static void Main(string[] args)
        {

            string text = Console.ReadLine();


            var stack = new Stack<int>();

            for(int i=0;i< text.Length;i++)
            {
                var symbol = text[i];
                if (symbol == '(')
                {
                    stack.Push(i);
                }
                else if(symbol == ')')
                {
                    int indexOfOpeningBracket = stack.Pop();
                    string result = text.Substring(indexOfOpeningBracket, i - indexOfOpeningBracket + 1);
                    Console.WriteLine(result);
                }
                
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace _02._Emoji_Detector
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = Console.ReadLine();

            var matchesDigit = Regex.Matches(text, @"\d");

            long coolTreshold = 1;
            foreach (Match match in matchesDigit)
            {
                coolTreshold *= long.Parse(match.Value);
            }

            string emojiPattern = @"(:{2}|\*{2})(?<emoji>[A-z][a-z]{2,})\1";
            var emojiMatches = Regex.Matches(text, emojiPattern);
            int countValidEmojis = 0;

            List<string> coolEmojis = new List<string>();
            foreach (Match emoji in emojiMatches)
            {
                int coolness = 0;
                foreach (char c in emoji.Groups["emoji"].Value)
                {
                    coolness += (int)c;
                }
                if(coolness >= coolTreshold)
                {
                    coolEmojis.Add(emoji.ToString());
                }
                countValidEmojis++;
            }

            Console.WriteLine($"Cool threshold: { coolTreshold}");
            Console.WriteLine($"{countValidEmojis} emojis found in the text. The cool ones are:");
            if(coolEmojis.Count > 0)
            {
                foreach (string emoji in coolEmojis)
                {
                    Console.WriteLine(emoji);   
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace _05._Nether_Realms
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> names = Console.ReadLine()
                 .Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).OrderBy(d => d)
                 .ToList();
            Dictionary<string, int> health = new Dictionary<string, int>();
            Dictionary<string, decimal> damage = new Dictionary<string, decimal>();

            foreach (string name in names)
            {
                if (!health.ContainsKey(name) && !damage.ContainsKey(name))
                {
                    health[name] = GetHealth(name);
                    damage[name] = GetDamage(name);
                }
            }


            foreach (string name in names.OrderBy(n => n))
            {
                Console.WriteLine($"{name} - {health[name]} health, {damage[name]:F2} damage");
            }
        }
        static decimal GetDamage(string name)
        {
            string damagePattern = @"([-+])?\d+(\.\d+)?";
            //Problem with mine pattern;
           // string damagePattern = @"[\-\+]?[\d]+(?:[\.]*[\d]+|[\d]*)";
            var matches = Regex.Matches(name, damagePattern);

            decimal damage = 0;
            foreach (Match  match in matches)
            {
                damage += decimal.Parse(match.Value);
            }

            foreach (char c in name)
            {
                if(c == '*')
                {
                    damage *= 2;
                }
                else if(c == '/')
                {
                    damage /= 2;
                }
            }
            return damage;


        }
        static int GetHealth(string name)
        {
            string healthPatttern = @"[^0-9\+\-*/\.]";
           // string healthPatttern = @"[^0-9\+\-\*\/\.]+";
            var matches = Regex.Matches(name, healthPatttern);
            int health = 0;
            foreach (Match match in matches)
            {
                char currCh = char.Parse(match.Value);
                health += (int)(currCh);
            }
            return health;
        }
    }
}
<file_sep>﻿using System;

namespace TIme_15minutes
{
    class Program
    {
        static void Main(string[] args)
        {
            int hour = int.Parse(Console.ReadLine());
            int minutes = int.Parse(Console.ReadLine());
           // Console.WriteLine(minutes);
           //if minutes are like 01 they are used as 1
           if(hour>=0 && hour<=23 && minutes>=0 && minutes<=59)
            {
                if(minutes+15<=59)
                {
                    
                        Console.WriteLine($"{hour}:{minutes+15}");
                    
                }
                else
                {
                    int sum = minutes + 15;
                    minutes = sum - 60;
                    if (hour + 1 == 24)
                    {
                        hour = 0;
                    }
                    else
                    {
                        hour++;
                    }
                    if(minutes<10)
                    {
                        Console.WriteLine($"{hour}:0{minutes}");
                    }
                    else
                        Console.WriteLine($"{hour}:{minutes}");

                
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace P03.Stack
{
    class Program
    {
        static void Main(string[] args)
        {
            var stack = new Stack<int>();

            string command;
            while ((command = Console.ReadLine()) != "END")
            {
                var cmdArgs = command
                .Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries);
                //string[] commandArgs = command.Split(" ");
                if (cmdArgs.Length > 1)
                {
                    //commandArgs = commandArgs.Skip(1).Split(",");
                    //command = commandArgs.Skip(1).ToString();
                    //var cmdArgs = command.Split(", ").Select(int.Parse);
                    var elements = cmdArgs.Skip(1).Select(int.Parse);

                    stack.Push(elements);
                }
                else if (cmdArgs[0] == "Push")
                {
                    int elemToPush = int.Parse(cmdArgs[1]);
                    stack.Push(elemToPush);
                }
                else if (command == "Pop")
                {
                    try
                    {
                        stack.Pop();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }
                }
            }
            PrintStack(stack);
            PrintStack(stack);

        }

        private static void PrintStack(Stack<int> stack)
        {
            foreach (var item in stack)
            {
                Console.WriteLine(item);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace List
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = new List<int>();
            list.Add(5);
            list.Add(6);
            list.Add(-51);
            list.Add(33);

            //list.RemoveAt(1);
            RemoveSoftuni(list,6);
            Console.WriteLine($"list[0]={list[0]}");
            Console.WriteLine($"Count:{list.Count}");

                
        }
        static void RemoveSoftuni(List<int> list, int element)
        {
            list.Remove(element);
        }
    }
}
<file_sep>﻿using P04.PizzaCalories.Ingredients;
using System;
using System.Collections.Generic;
using System.Text;

namespace P04.PizzaCalories
{
    public class Pizza
    {
        private string name;
       // private Dough dough;
        private int numberOfToppings;

        public Pizza(string name,Dough dough)
        {
            this.Name = name;
            this.Dough = dough;

            this.TotalCalories += this.Dough.DoughCalories();
        }

        public string Name
        {
            get
            {
                return this.name;
            }
            private set
            {
                if(string.IsNullOrEmpty(value) || value.Length > 15)
                {
                    throw new ArgumentException("Pizza name should be between 1 and 15 symbols.");
                }
                this.name = value;
            }
        }
        public int NumberOfToppings
        {
            get
            {
                return this.numberOfToppings;
            }
            private set
            {
                if(numberOfToppings < 0 || numberOfToppings > 10)
                {
                    throw new ArgumentException("Number of toppings should be in range [0..10].");
                }
                this.numberOfToppings = value;
            }
        }
        public Dough Dough { get; set; }
        public double TotalCalories { get; private set; }

        public void AddTopping(Topping topping)
        {
            this.TotalCalories += topping.ToppingCalories();
            this.NumberOfToppings++;
        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cars
{
    public interface IElectricCar : ICar
    {
        Battery Battery { get; }
    }
}
<file_sep>﻿using System;
using System.Data;
using System.Linq;

namespace _09.KaminoFactory_Working_
{
    class Program
    {
        static void Main(string[] args)
        {
            int length = int.Parse(Console.ReadLine());

            int LeftMostStartingIndex = -1;
            int MaxSeq = 0;
            int maxSeqIndex = -1;
            int[] MaxArray = new int[length];
            int seqCounter = 0;

            string command;
            while((command = Console.ReadLine()) != "Clone them!")
            {
                int[] currSequence = command
                    .Split('!')
                    .Select(int.Parse)
                    .ToArray();

                

                int startingIndex = 0;
                int sequnceLength = 0;
                for (int i = 0; i < currSequence.Length; i++)
                {
                    if(currSequence[i] == 1)
                    {
                        startingIndex = i;
                        sequnceLength++;
                    }
                    else
                    {
                       if(MaxSeq < sequnceLength)
                        {
                            MaxSeq = sequnceLength;
                            LeftMostStartingIndex = startingIndex;
                            maxSeqIndex = seqCounter;

                            currSequence.CopyTo(MaxArray,0);
                        }
                       else if(MaxSeq == sequnceLength)
                        {
                            if(LeftMostStartingIndex > startingIndex)
                            {
                                MaxSeq = sequnceLength;
                                LeftMostStartingIndex = startingIndex;

                                maxSeqIndex = seqCounter;

                                currSequence.CopyTo(MaxArray, 0);
                            }

                        }
                        startingIndex = 0;
                        sequnceLength = 0;

                    }
                }
                seqCounter++;
            }


            Console.WriteLine($"Best DNA sample {maxSeqIndex + 1} with sum: {MaxArray.Sum()}.");
            Console.WriteLine(string.Join(" ", MaxArray));
        }
    }
}
<file_sep>﻿using P05.Restaurant_Again_.Foods.Starter;
using System;
using System.Collections.Generic;
using System.Text;

namespace P05.Restaurant_Again_.Foods.Starter
{
    public class Soup : Starter
    {
        public Soup(string name, decimal price, double grams) 
            : base(name, price, grams)
        {
        }
    }
}
<file_sep>﻿using System;

namespace Graduation_pt2
{
    class Program
    {
        static void Main(string[] args)
        {
            string name = Console.ReadLine();
            int grade = 0;
            double sumMarks = 0;
            int timesBadGrades = 0;
            bool isExcluded = false;
            while(grade < 12)
            {
                double mark = double.Parse(Console.ReadLine());
                if(mark >= 4)
                {
                    sumMarks += mark; 
                    grade++;
                }
                else
                {
                    timesBadGrades++;
                    if(timesBadGrades > 1)
                    {
                        isExcluded = true;
                        break;
                    }
                    else
                    {
                        grade++;
                    }
                }
            }

        if(isExcluded == true)
            {
                Console.WriteLine($"{name} has been excluded at {grade} grade");
            }
        else
            {
                Console.WriteLine($"{name} graduated. Average grade: {sumMarks / grade:F2}");

            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._Memory_Game
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = Console.ReadLine().Split(' ',StringSplitOptions.RemoveEmptyEntries).ToList();
            int movesMade = 0;
            string input;
            bool haveWon = false;

            while((input = Console.ReadLine()) != "end")
            {
                int[] indexes = input.Split(' ',StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
                int index1 = indexes[0];
                int index2 = indexes[1];
                movesMade++;

                if(index1 < 0 || index1 >= list.Count || index2 < 0 || index2 >= list.Count
                   || index1 == index2)
                {
                    int indexToAddTo = list.Count / 2;
                    string elemToAdd2Times = $"-{movesMade}a";
                    list.Insert(indexToAddTo, elemToAdd2Times);
                    list.Insert(indexToAddTo, elemToAdd2Times);

                    Console.WriteLine("Invalid input! Adding additional elements to the board");
                }
                else
                {
                    if(list[index1] == list[index2])
                    {
                        string elToDelete = list[index1];
                        Console.WriteLine($"Congrats! You have found matching elements - {list[index1]}!");
                        list.RemoveAll(i => i == elToDelete);
                    }
                    else
                    {
                        Console.WriteLine("Try again!");
                    }

                    if (!list.Any())
                    {
                        haveWon = true;
                        break;
                    }
                }

            }
            if (haveWon)
            {
                Console.WriteLine($"You have won in {movesMade} turns!");
            }
            else
            {
                Console.WriteLine($"Sorry you lose :(\n" +$"{string.Join(' ',list)}");
            }

        }
    }
}
<file_sep>#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct player_t {
	char name[10];
	int poreden_num;
};
struct game_t {
	int curr_round;
	struct player_t* arr;
	int board[16];
	int size;
};

int roll_die()
{
	int arr[] = { 1,2,3,4,5,6 };
	int num = arr[rand() % 6];
	return num;

}
void move_player(struct game_t* game, struct player_t* player)
{
	//game->arr = malloc(4*sizeof(struct player_t));
	int por_num = player->poreden_num;
	int is_occupied = 0;
	int moved_pos = roll_die();
	printf("DICE:NOM:%d:%dpos\n", player->poreden_num, moved_pos);
	for (int i = 0; i < 16; i++)
	{
		if (player->poreden_num == game->board[i])
		{
			game->board[i] = 0;

			for (int j = 0; j < game->size; j++)
			{
				if ((game->board[i + moved_pos] == game->arr[j].poreden_num) || (game->board[((i + moved_pos) - 16)] == game->arr[j].poreden_num))
				{
					for (int k = 0; k < 16; k++)
					{
						if (game->board[k] == game->arr[j].poreden_num)
						{
							game->board[k] = 0;
						}
					}

					//free(game->arr+j);
					for (int z = j; z < game->size; z++)
					{
						game->arr[z] = game->arr[z + 1];
					}
					game->size--;

					//free(game->arr[3]);



					game->arr = realloc(game->arr, game->size * sizeof(struct player_t));



					//memmove(game->arr+j,game->arr+j+1,(3-j)*sizeof(int));
					//is_occupied = 1;
					//struct player_t *tmp = game->arr[j+1];

					//arr[j]=tmp;
					break;
				}
			}


			//if(is_occupied==0)
			//{
			if ((i + moved_pos) >= 16)
			{
				int index = (i + moved_pos) - 16;
				game->board[index] = por_num;
				break;
			}
			else
			{
				game->board[i + moved_pos] = por_num;
				break;
			}
			//   }    
		}

	}


}

int play_round(struct game_t* game)
{
	game->curr_round++;

	//	
	for (int i = 0; i < 16; i++)
	{
		printf("%d\n", game->board[i]);
	}
	printf("\n");

	for (int k = 0; k < game->size; k++)
	{
		printf("%d %s %d\n", k, game->arr[k].name, game->arr[k].poreden_num);
	}

	//
	printf("Starting round %d\n", game->curr_round);
	for (int i = 0; i < game->size; i++)
	{

		move_player(game, game->arr + i);
		if (game->size == 1)
		{
			return 1;
		}

	}
	if (game->size >= 2)
	{
		return 0;
	}

}
void play_game(struct game_t* game)
{
	int result = 0;
	while (result != 1)
	{
		result = play_round(game);

	}


}


int main()
{
	//struct player_t fir={"Gosho",0};
	//fir.poreden_num = roll_die();
	//printf("%d",fir.poreden_num);

	//struct game_t game;
	   // game.curr_round = 1;



	   // game.arr=malloc(4*sizeof(struct player_t));


	struct player_t player1 = { "Vladi", 1 };
	struct player_t player2 = { "Gosho", 2 };
	struct player_t player3 = { "Mitko", 3 };
	struct player_t player4 = { "Ivan", 4 };

	struct player_t* players = malloc(4 * sizeof(struct player_t));
	players[0] = player1;
	players[1] = player2;
	players[2] = player3;
	players[3] = player4;



	struct game_t game = { 0, players };
	game.size = 4;
	game.arr = players;
	// struct player_t players[4] = {{"First",1},{"Second",2},{"Third",3},{"Fourth",4}};
	// game.arr = players;

	game.board[0] = 1;
	game.board[1] = 2;
	game.board[2] = 3;
	game.board[3] = 4;
	game.board[4] = 0;
	game.board[5] = 0;
	game.board[6] = 0;
	game.board[7] = 0;
	game.board[8] = 0;
	game.board[9] = 0;
	game.board[10] = 0;
	game.board[11] = 0;
	game.board[12] = 0;
	game.board[13] = 0;
	game.board[14] = 0;
	game.board[15] = 0;


	///MOVING PLAYERS    
	  //move_player(&game, &game.arr[3]);
   //   move_player(&game, &game.arr[1]);
	//  move_player(&game, &game.arr[1]);
	 // move_player(&game, &game.arr[1]);

	 // for(int j=0;j<   	

/////ROUND

	//printf("Resultat ot rounda:%d\n",play_round(&game));	



/////GAME

	printf("Game:\n");
	play_game(&game);


	for (int i = 0; i < 16; i++)
	{
		printf("%d\n", game.board[i]);
	}
	printf("\n");

	for (int k = 0; k < game.size; k++)
	{
		printf("%d %s %d\n", k, game.arr[k].name, game.arr[k].poreden_num);
	}





	return 0;




}

<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P01.GenericBoxofString
{
    public class Box<T> where T: IComparable
    {
        public Box(List<T> value)
        {
            this.Values = value;
        }
        public List<T> Values { get; set; }

        public void SwapElementsByIndex(List<T> items, int index1, int index2)
        {
            T temp = items[index1];
            items[index1] = items[index2];
            items[index2] = temp;
        }
        public int CountGreaterElements(List<T> list,T elementToCompare)
        {
            int counter = 0;
            foreach (var element in list)
            {
                if(elementToCompare.CompareTo(element) < 0)
                {
                    counter++;
                }
            }
            return counter;
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in this.Values)
            {
                sb.AppendLine($"{item.GetType()}: {item}");
            }

            return sb.ToString().TrimEnd();
        }

    }
}
<file_sep>﻿using System;

namespace _02.Mountain_Rain
{
    class Program
    {
        static void Main(string[] args)
        {
            double recordInSec = double.Parse(Console.ReadLine());
            double recordInMet = double.Parse(Console.ReadLine());
            double timeFor1m = double.Parse(Console.ReadLine());

            double secGeorge = recordInMet * timeFor1m;
            double timesSlow = Math.Floor(recordInMet / 50);
            secGeorge = secGeorge + timesSlow * 30;

            if(secGeorge < recordInSec)
            {
                Console.WriteLine($"Yes! The new record is {secGeorge:F2} seconds.");
            }
            else
            {
                Console.WriteLine($"No! He was {secGeorge-recordInSec:F2} seconds slower.");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _07._Max_Sequence_of_Equal_Elements
{
    class Program
    {
        static void Main(string[] args)
        {
        //    int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
        //    int startIndex = 0;
        //    int endIndex = 0;
        //    int countSeq = 0;
        //    for (int i = 0; i < 1; i++)
        //    {
        //        for (int j = 0; j < arr.Length; j++)
        //        {
        //            if(arr[i] == arr[j])
        //            {
        //                startIndex = j;
        //                countSeq++;
        //            }
        //            else
        //            {
        //                countSeq = 0;
        //                endIndex = j-1;
        //            }
        //        }
        //    }
        //    Console.WriteLine(startIndex);
        //    Console.WriteLine(endIndex);
        //}


        int[] numbers = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int counter = 0;
        int winningCounter = 0;
        int index = 0;
        string number = string.Empty;

            for (int i = 0; i<numbers.Length - 1; i++)
            {
                if (numbers[i] == numbers[i + 1])
                {
                    counter++;
                    if (counter > winningCounter)
                    {
                        winningCounter = counter;
                        index = i; 
                        number = numbers[i].ToString();
                    } 
                }
                else
                {
                    counter = 0;
                }
            }
            for (int i = 0; i <= winningCounter; i++)
            {
                Console.Write(number + " ");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _04._Students
{
    class Student
    {
        public Student(string firstName,string lastName ,float grade)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
            this.Grade = grade;
        }

        public string FirstName { get; set; }
        public string LastName { get; set; }
        public float Grade { get; set; }

        public override string ToString()
        {
            // return base.ToString();
            return $"{this.FirstName} { this.LastName}: { this.Grade:F2}";
            
        }

    }
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());

            List<Student> students = new List<Student>();

            for (int i = 0; i < count; i++)
            {
                string[] info = Console.ReadLine().Split();
                string firstName = info[0];
                string lastName = info[1];
                float grade = float.Parse(info[2]);

                Student student = new Student(firstName, lastName, grade);
                students.Add(student);
            }
            //students.OrderByDescending(x => x.Grade);
            //for (int i = 0; i < students.Count; i++)
            //{
            //    Console.WriteLine(students[i].ToString());
            //}

            foreach (Student student in students.OrderByDescending(x => x.Grade))
            {
                Console.WriteLine(student.ToString());
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _07._Student_Academy
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, List<double>> students = new Dictionary<string, List<double>>();

            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string name = Console.ReadLine();
                double grade = double.Parse(Console.ReadLine());
                if (!students.ContainsKey(name))
                {
                    students[name] = new List<double>();
                }
                students[name].Add(grade);
            }

            Dictionary<string, double> studentsAverage = new Dictionary<string, double>();

            foreach (var kvp in students)
            {
                studentsAverage[kvp.Key] = kvp.Value.Average();
            }

            studentsAverage = studentsAverage
                .Where(kvp => kvp.Value >= 4.50)
                .OrderByDescending(kvp => kvp.Value)
                .ToDictionary(a => a.Key, b => b.Value);

            foreach (var kvp in studentsAverage)
            {
                Console.WriteLine($"{kvp.Key} -> {kvp.Value:F2}");
            }
        }
    }
}
<file_sep>﻿using System;

namespace Combinations
{
    class Program
    {
        static void Main(string[] args)
        {
            int counter = 0;
            int n = int.Parse(Console.ReadLine());
            for(int x1=0;x1<=n;x1++)
            {
                for(int x2 = 0; x2<=n;x2++)
                {
                    for(int x3 = 0;x3<=n;x3++)
                    {
                        if ((x1 + x2 + x3) == n)
                        {
                            counter++;
                        }
                    }
                }
            }
            Console.Write(counter);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace _01._Count_Chars_in_a_String
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = Console.ReadLine();

            Dictionary<char, int> dict = new Dictionary<char, int>();

            for (int i = 0; i < text.Length; i++)
            {
                char currCh = text[i];
                if(currCh == ' ')
                {
                    continue;
                }
                if (!dict.ContainsKey(currCh))
                {
                    dict[currCh] = 1;
                }
                else
                {
                    dict[currCh]++;
                }
            }

            foreach (var item in dict)
            {
                Console.WriteLine($"{item.Key} -> {item.Value}");
            }




            //for (int i = 0; i < word.Length; i++)
            //{
            //    char symbol = char.Parse(word[i]);
            //    Console.WriteLine(symbol);
               
            //}


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P01.Vehicles.Common
{
    public static class ExceptionMessage
    {
        public static string NotEnoughFuelExceptionMessage = "{0} needs refueling";
        public static string InvalidTypeVehicleExceptionMessage = "Invalid vehicle type";
        public static string InvalidFuelTankExceptionMessage = "Cannot fit {0} fuel in the tank";
        public static string FuelIsNegativeOrZero = "Fuel must be a positive number";
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._Character_Multiplier
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] inpArgs = Console.ReadLine()
                .Split()
                .ToArray();

            Console.WriteLine(CharMultiplier(inpArgs[0], inpArgs[1]));

        }
        public static int CharMultiplier(string f, string s)
        {
            int sum = 0;
            int shorterLen = 0;

            if(f.Length != s.Length)
            {
             shorterLen = f.Length > s.Length ? s.Length : f.Length;

            }
            else
            {
                shorterLen = f.Length;
            }

            for (int i = 0; i < shorterLen; i++)
            {
                sum += (int)(s[i] * f[i]);
            }

            if(shorterLen == f.Length && shorterLen < s.Length)
            {
                for (int i = f.Length; i < s.Length; i++)
                {
                    sum += (int)(s[i]);
                }
            }
            else if(shorterLen == s.Length && shorterLen < f.Length)
            {
                for (int i = s.Length; i < f.Length; i++)
                {
                    sum += (int)(f[i]);
                }
            }
            return sum;
        }
    }
    
}
<file_sep>using NUnit.Framework;
using System;

[TestFixture]
public class AxeTests
{
    [Test]
    public void AxeShouldLooseDurabilityAfterAttack()
    {
        //Arrange
        var axe = new Axe(10, 5);
        var target = new Dummy(100, 500);
        //Act
        axe.Attack(target);

        //Assert
        Assert.That(axe.DurabilityPoints, Is.EqualTo(4));

    }
    [Test]
    public void AxeShouldThrowExceptionIfAttackIsMadeWithBrokenWeapon()
    {
        //Arrange
        var axe = new Axe(10, 0);
        var target = new Dummy(100, 500);
        
       

        //Assert
        Assert.That(() => axe.Attack(target),//Act
            Throws.InvalidOperationException
            .With.Message.EqualTo("Axe is broken."));
    }
}<file_sep>﻿using System;

namespace SkiTrip
{
    class Program
    {
        static void Main(string[] args)
        {
            int countDays = int.Parse(Console.ReadLine());
            string typeRoom = Console.ReadLine();
            string grade =Console.ReadLine();

            countDays = countDays - 1;
            double price = 0;
            switch(typeRoom)
            {
                case "room for one person":
                    price = countDays * 18;
                    break;
                case "apartment":
                    price = countDays * 25;
                    if (countDays < 10)
                    {
                        price = price - price * 0.3;
                    }
                    else if (countDays >= 10 && countDays <= 15)
                    {
                        price = price - price * 0.35;
                    }
                    else
                    {
                        price = price - price * 0.5;
                    }
                    break;
                case "president apartment":
                    price = countDays * 35;
                    if (countDays < 10)
                    {
                        price = price - price * 0.1;
                    }
                    else if (countDays >= 10 && countDays <= 15)
                    {
                        price = price - price * 0.15;
                    }
                    else
                    {
                        price = price - price * 0.2;
                    }
                    break;
            }
            if(grade == "positive")
            {
                price = price + price * 0.25;
            }
            else
            {
                price = price - price * 0.1; 
            }

            Console.WriteLine($"{price:F2}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _10.Softuni_Course_Planning
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = Console.ReadLine().Split(", ").ToList();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "course start")
                {
                    break;
                }
                string[] command = input.Split(":");
                
                string lessonTitle = command[1];
                switch (command[0])
                {
                    
                    case "Add":
                        //string lessonTitle = command[1];
                        if (!list.Contains(lessonTitle))
                        {
                            list.Add(lessonTitle);
                        }
                        break;
                    case "Insert":
                       // string lessonTitle2 = command[1];
                        int index = int.Parse(command[2]);
                        if (!list.Contains(lessonTitle))
                        {
                            list.Insert(index, lessonTitle);
                        }
                        break;
                    case "Remove":
                        if (list.Contains(lessonTitle))
                        {
                            list.Remove(lessonTitle);
                            if (list.Contains($"{lessonTitle}-Exercise"))
                            {
                                list.Remove($"{lessonTitle}-Exercise");
                            }
                        }
                        break;
                    case "Swap":
                         string lessonTitle2 = command[2];
                        if(list.Contains(lessonTitle) && list.Contains(lessonTitle2))
                        {
                            
                            string temp = command[1];
                            command[1] = command[2];
                            command[2] = temp;
                            int i1 = list.IndexOf(command[1]);
                            int i2 = list.IndexOf(command[2]);
                            list[i1] = command[2];
                            list[i2] = command[1];
                            if (list.Contains($"{command[1]}-Exercise"))
                            {
                                int ind = list.IndexOf(command[1]);
                                list.Remove($"{command[1]}-Exercise");
                                list.Insert(ind+1, $"{command[1]}-Exercise");
                            }
                            if (list.Contains($"{command[2]}-Exercise"))
                            {
                                int ind2 = list.IndexOf(command[2]);
                                list.Remove($"{command[2]}-Exercise");
                                list.Insert(ind2 + 1, $"{command[2]}-Exercise");
                            }
                        }
                        break;
                    case "Exercise":
                        if(list.Contains(lessonTitle) && !list.Contains($"{lessonTitle}-Exercise"))
                        {
                            int i = list.IndexOf(lessonTitle);
                            list.Insert(i+1, $"{lessonTitle}-Exercise");
                        }
                        if (!list.Contains(lessonTitle))
                        {
                            list.Add(lessonTitle);
                            list.Add($"{lessonTitle}-Exercise");
                        }
                        break;

                }
            }
            for (int i = 0; i < list.Count; i++)
            {
                Console.WriteLine($"{i + 1}.{list[i]}");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _02._Knights_of_Honor
{
    class Program
    {
        static void Main(string[] args)
        {
            //Action<string> printString = Console.WriteLine;

            //string[] names = Console.ReadLine()
            //    .Split();

            //names
            //    .Select(n => "Sir " + n)
            //    .ToList()
            //    .ForEach(printString);

            Action<string> printString = (name) =>
            {
                Console.WriteLine("Sir " + name);
            };

            Console.ReadLine()
                .Split()
                .ToList()
                .ForEach(printString);





                
        }
    }
}
<file_sep>﻿using P04.WildFarm.Models.Foods;
using System;
using System.Collections.Generic;
using System.Text;

namespace P04.WildFarm.Models.Animals.Mammals.Felines
{
    public class Cat : Feline
    {
        private const double WEIGHT_MULT = 0.30;
        public Cat(string name, double weight, string livingRegion, string breed)
            : base(name, weight, livingRegion, breed)
        {
        }

        public override double WeightMultiplier
            => WEIGHT_MULT;

        public override ICollection<Type> PrefferedFoods
            => new List<Type>() { typeof(Vegetable), typeof(Meat)};

        public override void ProduceSound()
        {
            Console.WriteLine("Meow");
        }
    }
}
<file_sep>﻿using System;

namespace VowelsSum
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = Console.ReadLine();
            int sumVolews = 0;
            for(int i=0; i < text.Length; i++)
            {
                char letter = text[i];
                switch(letter)
                {
                    case 'a':
                        sumVolews = sumVolews + 1;
                        break;
                    case 'e':
                        sumVolews = sumVolews + 2;
                        break;
                    case 'i':
                        sumVolews = sumVolews + 3;
                        break;
                    case 'o':
                        sumVolews = sumVolews + 4;
                        break;
                    case 'u':
                        sumVolews = sumVolews + 5;
                        break;

                }
            }
            Console.WriteLine(sumVolews);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace P07.RawData
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Car> cars = new List<Car>();
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string[] carArgs = Console.ReadLine()
                    .Split();
                string model = carArgs[0];
                Engine engine = new Engine(int.Parse(carArgs[1]), int.Parse(carArgs[2]));
                Cargo cargo = new Cargo(int.Parse(carArgs[3]), carArgs[4]);
                Tire tire1 = new Tire(double.Parse(carArgs[5]), int.Parse(carArgs[6]));
                Tire tire2 = new Tire(double.Parse(carArgs[7]), int.Parse(carArgs[8]));
                Tire tire3 = new Tire(double.Parse(carArgs[9]), int.Parse(carArgs[10]));
                Tire tire4 = new Tire(double.Parse(carArgs[11]), int.Parse(carArgs[12]));
                List<Tire> tires = new List<Tire>() { tire1, tire2, tire3, tire4 };

                Car car = new Car(model, engine, cargo, tires);

                cars.Add(car);
            }

            string typeCars = Console.ReadLine();
            if(typeCars == "fragile")
            {
                var sortedCars = cars
                    .Where(c => c.Cargo.Type == "fragile")
                    .Where(c => c.Tires.Any(t => t.Pressure < 1))
                    .ToList();
                Console.WriteLine(string.Join(Environment.NewLine, sortedCars.Select(c => c.Model)));
            }
            else
            {
                var sortedCars = cars
                    .Where(c => c.Cargo.Type == "flamable")
                    .Where(c => c.Engine.Power > 250)
                    .ToList();
                Console.WriteLine(string.Join(Environment.NewLine, sortedCars.Select(c => c.Model)));

            }

        }
    }
}
<file_sep>﻿using System;

namespace AccountBallance
{
    class Program
    {
        static void Main(string[] args)
        {
            string command = Console.ReadLine();
            double sum = 0;
            while(command != "NoMoreMoney")
            {
                double num = double.Parse(command);
                if(num < 0)
                {
                    Console.WriteLine("Invalid operation!");
                    break;
                }
                else
                {
                    sum += num;
                    Console.WriteLine($"Increase: {num:F2}");
                }
                command = Console.ReadLine();
             
            }
            Console.WriteLine($"Total: {sum:F2}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq; 
namespace ReverseStrings
{   
    class Program
    {   
        static void Main(string[] args)
        {

            var input = Console.ReadLine();
            //Stack stack = new Stack();
            var stack = new Stack<char>();
            
            
            // Stack<int> stack = new;
           // Stack<int>();

            foreach(var ch in input)
            {
                stack.Push(ch);
            }
            ////without foreach to fill the stack use this
            //var stack = new Stack<char>(input);
            ////Even faster way is 
            //var stack = new Stack<char>(Console.ReadLine());

            while (stack.Count != 0)
            {
                Console.Write(stack.Pop());
            }
            //Console.WriteLine();
            


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Encapsulation
{
    public class Car
    {
        public Car(string make,string model)//////immutable 
        {
            this.Make = make;
            this.Model = model;
        }
        public string Model { get; }
        public string Make { get; }
    }
}
<file_sep>﻿using System;

namespace Beehive_Defence
{
    class Program
    {
        static void Main(string[] args)
        {
            int beeCount = int.Parse(Console.ReadLine());
            int healthBear = int.Parse(Console.ReadLine());
            int attackBear = int.Parse(Console.ReadLine());

            while(true)
            {
                beeCount = beeCount - attackBear;
                if(beeCount<100)
                {   if(beeCount<0)
                    {
                        beeCount = 0;
                    }
                    Console.WriteLine($"The bear stole the honey! Bees left {beeCount}.");
                    break;
                }
                healthBear -= beeCount * 5; 
                if(healthBear<=0)
                {
                    Console.WriteLine($"Beehive won! Bees left {beeCount}.");
                    break;
                }
            }    

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime;

namespace _02._Articles
{
    class Article
    {
        public Article(string title, string content, string author)
        {
            this.Title = title;
            this.Content = content;
            this.Author = author;
        }
        public string Title { get; set; }
        public string Content { get; set; }
        public string Author { get; set; }

        public void Edit(string newContent)
        {
            this.Content = newContent;
        }
        public void ChangeAuthor(string newAuthor)
        {
            this.Author = newAuthor;
        }

        public void Rename(string newTitle)
        {
            this.Title = newTitle;
        }
        public override string ToString()
        {
            //return base.ToString();
            return $"{this.Title} - {this.Content}: {this.Author}";
        }

    }
    class Catalog
    {
        public Catalog()
        {
            this.Articles = new List<Article>();
        }
        public List<Article> Articles { get; set; }
    }
    class Program
    {
        static void Main(string[] args)
        {


            Catalog catalog = new Catalog();

            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string[] input = Console.ReadLine().Split(", ");
                string title = input[0];
                string content = input[1];
                string author = input[2];

                Article article = new Article(title, content, author);

                catalog.Articles.Add(article);

            }
            string criteria = Console.ReadLine();
            if(criteria == "title")
            {
                foreach (Article article in catalog.Articles.OrderBy(x => x.Title))
                {
                    Console.WriteLine(article.ToString());
                }
            }
            else if(criteria == "content")
            {
                foreach (Article article in catalog.Articles.OrderBy(x => x.Content))
                {
                    Console.WriteLine(article.ToString());
                }
            }
            else
            {
                foreach (Article article in catalog.Articles.OrderBy(x => x.Author))
                {
                    Console.WriteLine(article.ToString());
                }
            }

            
            
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace AverageStudentGrades
{
    class Program
    {
        static void Main(string[] args)
        {
           

            var grades = new Dictionary<string, List<decimal>>();
            
            int countOfStudents = int.Parse(Console.ReadLine());
            for (int i = 0; i < countOfStudents; i++)
            {
                string[] inputInfo = Console.ReadLine().Split();
                string name = inputInfo[0];
                decimal grade = decimal.Parse(inputInfo[1]);
                if(!grades.ContainsKey(name))
                {
                    grades.Add(name, new List<decimal>());
                }
                grades[name].Add(grade);

            }

            foreach (var (nameKey,gradeValues) in grades)
            {
                //Console.WriteLine($"{nameKey}->{string.Join(" ",gradeValues)} (avg: {gradeValues.Average():F2})");
                Console.Write($"{nameKey}->");
                foreach (var gradeValue in gradeValues)
                {
                    Console.Write($"{gradeValue:F2} ");
                }
                Console.Write($"(avg:{gradeValues.Average():F2})");
                Console.WriteLine(); 
            }
        }
    }
}
<file_sep>﻿using System;

namespace ExamPreparation
{
    class Program
    {
        static void Main(string[] args)
        {
            int countBadGradesNeeded = int.Parse(Console.ReadLine());
            string nameOfExcercise = Console.ReadLine();
            int grade = 0;
            int countWorseGrades = 0;
            int countAllGrades = 0;
            double sumgrades = 0;
            string lastExcercise = "";
            while (nameOfExcercise != "Enough" && countBadGradesNeeded != countWorseGrades)
            {
                grade = int.Parse(Console.ReadLine());
                lastExcercise = nameOfExcercise;
                if (grade <= 4)
                {
                    countWorseGrades++;
                }
                else
                {
                    countAllGrades++;
                }
                sumgrades = sumgrades + grade;
                nameOfExcercise = Console.ReadLine();
                
            }
            if(nameOfExcercise == "Enough")
            {
                Console.WriteLine($"Average score: {sumgrades /(countAllGrades + countWorseGrades):F2}");
                Console.WriteLine($"Number of problems: {countWorseGrades+countAllGrades}");
                Console.WriteLine($"Last problem: {lastExcercise}");
            }
            else
            {
                Console.WriteLine($"You need a break, { countWorseGrades} poor grades.");
            }

        }
    }
}
<file_sep>﻿using Moq;
using NUnit.Framework;
using Skeleton;

[TestFixture]
public class HeroTests
{
    [Test]
    public void HeroShouldGainXpIfTargetDies()
    {

        const int experience = 200; 
        //Arrange
        var fakeWeapon = Mock.Of<IWeapon>();


        var fakeTarget = new Mock<ITarget>();

        fakeTarget
            .Setup(t => t.IsDead())
            .Returns(true);

        fakeTarget
            .Setup(t => t.GiveExperience())
            .Returns(experience);

        var hero = new Hero("TestHero", fakeWeapon);

        //Act
        hero.Attack(fakeTarget.Object);

        //Assert
        Assert.That(hero.Experience, Is.EqualTo(experience));
    }
}<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P06.FoodShortage
{
    interface IIdentifiable
    {       

        string GetId();
    }
}
<file_sep>﻿using System;

namespace StrongNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            int num1 = num;
            int sum = 0;
            while(num>0)
            {
                int subnum = num % 10;
                num = num / 10;
             //   Console.WriteLine($"NUM:{num}");
                int sumInside = 1;
                for(int i = 1; i <= subnum; i++)
                {
                    sumInside *= i;
                }
                sum += sumInside;

               // Console.WriteLine($"SumInside:{sumInside}");
              //  Console.WriteLine($"Sum:{sum}");

            }
            if (sum == num1)
            {
                Console.WriteLine("yes");
            }
            else
            {
                Console.WriteLine("no");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace _01.Furniture
{
    class Program
    {
        static void Main(string[] args)
        {
            string pattern = @">>(?<name>\w+)<<(?<price>\d+(.\d+)?)!(?<quantity>\d+)";

            List<string> purchasedFurniture = new List<string>();
            decimal moneySpend = 0;

            while (true)
            {
                string input = Console.ReadLine();
                if(input == "Purchase")
                {
                    break;
                }
                if (Regex.IsMatch(input, pattern))
                {
                    Match match = Regex.Match(input, pattern);

                    string name = match.Groups["name"].Value;
                    decimal price = decimal.Parse(match.Groups["price"].Value);
                    int quantity = int.Parse(match.Groups["quantity"].Value);

                    purchasedFurniture.Add(name);
                    moneySpend += price * quantity;
                }
            }

            Console.WriteLine("Bought furniture:");
            if (purchasedFurniture.Count > 0)
            {
            Console.WriteLine(string.Join(Environment.NewLine, purchasedFurniture));

            }

            Console.WriteLine($"Total money spend: {moneySpend:F2}");

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TestDemos.UnitTest1
{
    using NUnit.Framework;
    [TestFixture]
    public class CalculatorTests
    {

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _08._Anonymous_Threat
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> list = Console.ReadLine().Split().ToList();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "3:1")
                {
                    break;
                }
                string[] command = input.Split();

            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;

namespace _07._List_Manipulation_Advanced
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            bool isChanged = false;
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end")
                {
                    break;
                }
                string[] command = input.Split();
                if (command[0] == "Add")
                {
                    list.Add(int.Parse(command[1]));
                    isChanged = true;
                }
                else if (command[0] == "Remove")
                {
                    list.Remove(int.Parse(command[1]));
                    isChanged = true;

                }
                else if (command[0] == "RemoveAt")
                {
                    list.RemoveAt(int.Parse(command[1]));
                    isChanged = true;

                }
                else if(command[0] == "Insert")
                {
                    list.Insert(int.Parse(command[2]), int.Parse(command[1]));
                    isChanged = true;

                }
                switch (command[0])
                {

                    case "Contains":
                        DoesContain(list, int.Parse(command[1]));
                        break;
                    case "PrintEven":
                        PrintEven(list);
                        break;
                    case "PrintOdd":
                        PrintOdd(list);
                        break;
                    case "GetSum":
                        int sum = GetSum(list);
                        Console.WriteLine(sum);
                        break;
                    case "Filter":
                        string condition = command[1];
                        int num = int.Parse(command[2]);
                        Filter(list, condition, num);
                        break;


                }
            }
            if (isChanged)
            {
                Console.WriteLine(string.Join(" ", list));
            }
        }
        
        static void DoesContain(List<int> list,int number)
        {
            if (list.Contains(number))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No such number");
            }
        }
        static void PrintEven(List<int> list)
        {
            List<int> evenList = new List<int>();
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] % 2 == 0)
                {
                    evenList.Add(list[i]);
                }
            }
            Console.WriteLine(string.Join(" ", evenList));
        }
        static void PrintOdd(List<int> list)
        {
            List<int> oddList = new List<int>();
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] % 2 != 0)
                {
                    oddList.Add(list[i]);
                }
            }
            Console.WriteLine(string.Join(" ", oddList));
        }
        static int GetSum(List<int> list)
        {
            return list.Sum();
        }
        static void Filter(List<int> list , string condtion , int num)
        {
            List<int> filteredList = new List<int>();
            
                
                    for (int i = 0; i < list.Count; i++)
                    {
                        switch (condtion)
                        {
                             case "<":
                               if(list[i] < num)
                        {
                            filteredList.Add(list[i]);
                        }
                             break;

                            case ">":
                                if (list[i] > num)
                                 {
                            filteredList.Add(list[i]);

                                }
                             break;
                    case ">=":
                        if (list[i] >= num)
                        {
                            filteredList.Add(list[i]);

                        }
                        break;
                    case "<=":
                        if (list[i] <= num)
                        {
                            filteredList.Add(list[i]);

                        }
                        break;
                        }
                    }

            Console.WriteLine(string.Join(" ", filteredList));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P08.CollectionHierarchy.Contracts
{
    public interface IMyList : IRemovable
    {
        int Used { get; }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _01.Train
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            int maxCapacity = int.Parse(Console.ReadLine());
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end")
                {
                    break;
                }
                string[] command = input.Split();
                if(command[0] == "Add")
                {
                    list.Add(int.Parse(command[1]));
                }
                else
                {
                    int passeng = int.Parse(command[0]);
                    for (int i = 0; i < list.Count; i++)
                    {
                        if(list[i]+passeng <= maxCapacity)
                        {
                            list[i] += passeng;
                            break;
                        }
                    }
                }
                
            }
            Console.WriteLine(string.Join(" ", list));
        }
    }
}
<file_sep>﻿using System;

namespace GodzillavsKong
{
    class Program
    {
        static void Main(string[] args)
        {
            double budget = double.Parse(Console.ReadLine());
            int countStatist = int.Parse(Console.ReadLine());
            double priceClothes = double.Parse(Console.ReadLine());

            double deckorPrice = budget * 0.1;
            if(countStatist > 150 )
            {
                priceClothes = priceClothes - priceClothes * 0.1;
            }

             double  moneyNeeded = countStatist * priceClothes + deckorPrice ; 
             if(moneyNeeded > budget)
             {
                Console.WriteLine("Not enough money!");
                Console.WriteLine($"Wingard needs {moneyNeeded - budget:F2} leva more.");
             
             }
             else
             {
                Console.WriteLine("Action!");
                Console.WriteLine($"Wingard starts filming with {budget - moneyNeeded:F2} leva left.");
             }
            
        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace LibraryIterator
{
    public class Library :IEnumerable<Book>
    {
        private List<Book> books;

        public Library()
        {
        }

        public void Add(Book book)
        {
            this.books.Add(book);
        }

        public IEnumerator<Book> GetEnumerator()
        {
            return new BookIterator(this.books);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.books.GetEnumerator();
        }

        private class BookIterator : IEnumerator<Book>
        {
            private List<Book> books;
            private int index;

            public BookIterator(List<Book> books)
            {
                this.books = books;
            }
            
            public Book Current
            {
                get
                {
                    return this.books[this.index];
                }
            }

            object IEnumerator.Current => this.Current;

            public void Dispose()
            {
                throw new NotImplementedException();
            }

            public bool MoveNext()
            {
                return ++this.index < this.books.Count;
            }

            public void Reset()
            {
                this.index = -1;
            }
        }
    }
}
<file_sep>﻿using System;

namespace CareOfPuppy
{
    class Program
    {
        static void Main(string[] args)
        {
            int purchasedFoodInKg = int.Parse(Console.ReadLine());
            string command = Console.ReadLine();
            int sumFoodInGrams = 0;
            while(command!="Adopted")
            {
                int foodInGram = int.Parse(command);
                sumFoodInGrams += foodInGram;
                command = Console.ReadLine();
            }
            if(purchasedFoodInKg*1000>=sumFoodInGrams)
            {
                Console.WriteLine($"Food is enough! Leftovers: {purchasedFoodInKg*1000-sumFoodInGrams} grams.");
            }
            else
            {
                Console.WriteLine($"Food is not enough. You need {sumFoodInGrams - purchasedFoodInKg*1000} grams more.");
            }
        }
    }
}
<file_sep>﻿namespace P06.FoodShortage
{
    public class Pet : IBirthable
    {
        private string name;
        private string birthDate;

        public Pet(string name , string birthDate)
        {
            this.name = name;
            this.birthDate = birthDate;
        }

        public string GetBirth()
        {
            return this.birthDate;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _02._Average_Student_Grades
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Dictionary<string, List<decimal>> students = new Dictionary<string, List<decimal>>();

            for (int i = 0; i < n; i++)
            {
                string[] studentArgs = Console.ReadLine()
                    .Split();
                string studentName = studentArgs[0];
                decimal studentGrade = decimal.Parse(studentArgs[1]);

                if (!students.ContainsKey(studentName))
                {
                    students[studentName] = new List<decimal>();
                }
                students[studentName].Add(studentGrade);
            }

            foreach (var kvp in students)
            {
                Console.Write($"{kvp.Key} -> ");

                foreach (var grade in kvp.Value)
                {
                    Console.Write($"{grade:F2} ");
                }

                Console.WriteLine($"(avg: {kvp.Value.Average():F2})");

            }
        }
    }
}
<file_sep>﻿using System;
using System.ComponentModel;
using System.Runtime;

namespace _03.Calculations
{
    class Program
    {
        static void Main(string[] args)
        {
            string command = Console.ReadLine();
            int num1 = int.Parse(Console.ReadLine());
            int num2 = int.Parse(Console.ReadLine());
            int result = 0;
            switch (command)
            {
                case "add":
                    result = Add(num1, num2);
                    break;
                case "divide":
                    result = Divide(num1, num2);
                    break;
                case "substract":
                    result = Substract(num1, num2);
                    break;
                case "multiply":
                    result = Multiply(num1, num2);
                    break;
            }
            Console.WriteLine(result);
        }
        static int Add(int num1, int num2)
        {
            return (num1 + num2);
        }
        static int Substract(int num1, int num2)
        {
            return (num1 - num2);
        }
        static int Multiply(int num1, int num2)
        {
            return (num1 * num2);
        }
        static int Divide(int num1, int num2)
        {
            return (num1 / num2);
        }
    }
}
<file_sep>﻿using System;

namespace Cinema
{
    class Program
    {
        static void Main(string[] args)
        {
            string typeScene = Console.ReadLine();
            int rows = int.Parse(Console.ReadLine());
            int collons = int.Parse(Console.ReadLine());

            double income = 0;
            
            switch (typeScene)
            {
                case "Premiere":
                    income = rows * collons * 12.00;
                    break;
                case "Normal":
                    income = rows * collons * 7.50;
                    break;
                case "Discount":
                    income = rows * collons * 5.00;
                    break;

            }
            Console.WriteLine($"{income:F2} leva");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _06._Wardrobe
{
    class Program
    {
        static void Main(string[] args)
        {
            var wardrobe = new Dictionary<string, Dictionary<string, int>>();
            int n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                string[] cmdArgs = Console.ReadLine()
                    .Split(" -> ", StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();

                string color = cmdArgs[0];
                string[] clothesWithThisColor = cmdArgs[1]
                    .Split(",", StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();
                if (!wardrobe.ContainsKey(color))
                {
                    wardrobe[color] = new Dictionary<string, int>();
                }
                foreach (var cloth in clothesWithThisColor)
                {
                    if (!wardrobe[color].ContainsKey(cloth))
                    {
                        wardrobe[color][cloth] = 0;
                    }
                    wardrobe[color][cloth]++;
                }

            }
            string[] itemSearchedArgs = Console.ReadLine()
                .Split(" ",StringSplitOptions.RemoveEmptyEntries)
                .ToArray();


            foreach (var kvp in wardrobe)
            {
                Console.WriteLine($"{kvp.Key} clothes:");
                foreach (var cloth in kvp.Value)
                {
                    if(kvp.Key == itemSearchedArgs[0] && cloth.Key == itemSearchedArgs[1])
                    {
                        Console.WriteLine($"* {cloth.Key} - {cloth.Value} (found!)");
                    }
                    else
                    {
                    Console.WriteLine($"* {cloth.Key} - {cloth.Value}");
                    }

                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Data;
using System.Linq;

namespace SumMatrixElements
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] sizes = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
            int[,] matrix = new int[sizes[0], sizes[1]];

            for(int row = 0;row<matrix.GetLength(0);row++)
            {
                int[] colElements = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
                 for(int col = 0;col<matrix.GetLength(1);col++)
                 {
                    matrix[row, col] = colElements[col];
                 }
            }
            int sum = 0;
            for(int row = 0;  row < matrix.GetLength(0);row++)
            {
               for(int col = 0;col < matrix.GetLength(1);col++)
                {
                    sum += matrix[row,col];
                }
            }
            Console.WriteLine(matrix.GetLength(0));
            Console.WriteLine(matrix.GetLength(1)); 
            Console.WriteLine(sum);
            
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace JaggedArraysDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            int rows = int.Parse(Console.ReadLine());

            int[][] array = new int[rows][];

            for (int row = 0; row < rows; row++)
            {
                int[] currentRow = Console.ReadLine()
                    .Split()
                    .Select(int.Parse)
                    .ToArray();

                array[row] = currentRow;
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03._Problem
{
    class Program
    {
        static void Main(string[] args)
        {
            //Dictionary<string, List<string>> emails = new Dictionary<string, List<string>>();

            //string input;
            //while((input = Console.ReadLine()) != "Statistics")
            //{
            //    string[] command = input.Split("->", StringSplitOptions.RemoveEmptyEntries);

            //    if(command[0] == "Add")
            //    {
            //        string username = command[1];
            //        if(emails.ContainsKey(username))
            //        {
            //            Console.WriteLine($"{username} is already registered");
            //        }
            //        else
            //        {
            //            emails[username] = new List<string>();
            //        }
            //    }
            //    else if(command[0] == "Send")
            //    {
            //        string username = command[1];
            //        string emailToSend = command[2];

            //        emails[username].Add(emailToSend);
            //    }
            //    else
            //    {
            //        string username = command[1];
            //        if(emails.ContainsKey(username))
            //        {
            //            emails.Remove(username);
            //        }
            //        else
            //        {
            //            Console.WriteLine($"{username} not found!");
            //        }
            //    }
            //}

            //emails = emails
            //    .OrderByDescending(kvp => kvp.Value.Count)
            //    .ThenBy(kvp => kvp.Key)
            //    .ToDictionary(a => a.Key, b => b.Value);


            //Console.WriteLine($"Users count: {emails.Count}");
            //foreach (string user in emails.Keys)
            //{
            //    Console.WriteLine(user);
            //    foreach (string email in emails[user])
            //    {
            //        Console.WriteLine($"- {email}");
            //    }
            //}

            for (int i = 10; i > 3; i -= 2)
            {
                Console.Write($"{i }");
            }


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _01.Person
{
    class Child:Person  
    {
    }
}
<file_sep>﻿using System;

namespace NumbersEndingIn7
{
    class Program
    {
        static void Main(string[] args)
        {
           for(int i=0;i<1000; i++)
            {
                if(i%10 == 7)
                {
                    Console.WriteLine(i);
                }
            }
        }
    }
}
<file_sep>﻿using System;

namespace Walking
{
    class Program
    {
        static void Main(string[] args)
        {
           int sumSteps = 0;
           bool goalReached = false;
           while(sumSteps < 10000)
            {
                string command = Console.ReadLine();
               
                if (command == "Going home")
                {
                    int stepsback = int.Parse(Console.ReadLine());
                    sumSteps = sumSteps + stepsback;
                    if(sumSteps >= 10000)
                    {   
                        goalReached = true;
                        break;
                    }
                    else
                    {
                        goalReached = false;
                        break;
                    }
                        
                }
                else
                {   int steps = int.Parse(command);
                    sumSteps = sumSteps + steps;
                }
               // Console.WriteLine(steps);
            }
           if(sumSteps >= 10000)
            {
                goalReached = true;
            }
            
           if(goalReached)
            {
                Console.WriteLine("Goal reached! Good job!");
                Console.WriteLine($"{sumSteps - 10000} steps over the goal!");
            }
            else
            {
                Console.WriteLine($"{10000 - sumSteps} more steps to reach goal.");
                
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04.NeedForSpeed.Car
{
    public class SportCar : Car
    {
        private const double defaultFuelConsumption = 10;

        public SportCar(int horsePower, double fuel) : base(horsePower, fuel)
        {

        }
        public override double FuelConsumption => defaultFuelConsumption;
        //{
        //    get
        //    {
        //        return this.FuelConsumption;
        //    }

        //    set
        //    {
        //        this.FuelConsumption = defaultFuelConsumption;
        //    }
        //}

        public override void Drive(double kilometers)
        {
            double fuelAfterDrive = this.Fuel - kilometers * this.FuelConsumption;
            if (fuelAfterDrive >= 0)
            {
                this.Fuel -= kilometers * this.FuelConsumption;
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace CountSameValuesInArray
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] input = Console.ReadLine().Split().Select(double.Parse).ToArray();

            Dictionary<double, int> dictionary = new Dictionary<double, int>();

            foreach (var currentNumber in input)
            {
                if (!dictionary.ContainsKey(currentNumber))
                {
                    dictionary.Add(currentNumber, 0);
                }
                dictionary[currentNumber]++;
            }

            foreach (var (key, value) in dictionary)
            {
                Console.WriteLine($"{key}-{value}times");
            }

            //double[] input = Console.ReadLine().Split().Select(double.Parse).ToArray();

            //Dictionary<double, int> dictionary = new Dictionary<double, int>();

            //foreach (var el in input)
            //{
            //    if(!dictionary.ContainsKey(el))
            //    {
            //        dictionary.Add(el, 0);
            //    }
            //    dictionary[el]++;
            //}

            //foreach (var (key,value) in dictionary)
            //{
            //    Console.WriteLine($"{key}-{value}");
            //}
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public class Airplane : Vehicle
    {
        public int MaxPeople { get; set; }
        public override string VrumVrum()
        {
            return "Airplane is flying";
        }

        public string VrumVrum(int people)
        {
            return $"Airplane is flying with {people}";
        }
    }
}
<file_sep>﻿using System;

namespace _05.Orders
{
    class Program
    {
        static void Main(string[] args)
        {
            string product = Console.ReadLine();

        }
        
    }
}
<file_sep>﻿using System;

namespace _01._Secret_Chat
{
    class Program
    {
        static void Main(string[] args)
        {
            string message = Console.ReadLine();

            string input;
            while((input = Console.ReadLine()) != "Reveal")
            {
                string[] command = input.Split(":|:");
                if(command[0] == "InsertSpace")
                {
                    int index = int.Parse(command[1]);
                    message = message.Insert(index, " ");

                    Console.WriteLine(message);
                }
                else if(command[0] == "Reverse")
                {
                    string subs = command[1];
                    if (message.Contains(subs))
                    {
                        int startIndex = message.IndexOf(subs);
                        message = message.Remove(startIndex, subs.Length);
                        char[] subsArr = subs.ToCharArray();
                        Array.Reverse(subsArr);
                        string reversedSubstr = new string(subsArr);
                        message += reversedSubstr;
                        Console.WriteLine(message);
                    }
                    else
                    {
                        Console.WriteLine("error");
                    }
                    
                }
                else
                {
                    string subs = command[1];
                    string replacement = command[2];
                    message = message.Replace(subs, replacement);

                    Console.WriteLine(message);
                }
            }

            Console.WriteLine($"You have a new text message: {message}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace P01.Bombs
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] bombEffectsInfo = Console.ReadLine()
                .Split(", ")
                .Select(int.Parse)
                .ToArray();
            int[] bombCasingInfo = Console.ReadLine()
                .Split(", ")
                .Select(int.Parse)
                .ToArray();

            Queue<int> bombEffects = new Queue<int>(bombEffectsInfo);
            Stack<int> bombCasings = new Stack<int>(bombCasingInfo);

            var bombs = new Dictionary<int, string>()
            {
                { 40,"Datura Bombs" }
                ,{60 ,"Cherry Bombs"}
                ,{120,"Smoke Decoy Bombs"}
            };

            Dictionary<string, int> madeBombsCount = new Dictionary<string, int>() 
            {
                { "Datura Bombs",0 }
                ,{"Cherry Bombs",0 }
                ,{"Smoke Decoy Bombs",0}
            };

            while(bombEffects.Any() && bombCasings.Any() && madeBombsCount.Any(kvp => kvp.Value < 3))
            {
                int currBombEffect = bombEffects.Peek();
                int currBombCasing = bombCasings.Peek();
                if(bombs.Any(kvp => kvp.Key == currBombEffect + currBombCasing))
                {
                    string bombMadeName = bombs[currBombCasing + currBombEffect];

                    madeBombsCount[bombMadeName]++;

                    bombEffects.Dequeue();
                    bombCasings.Pop();
                }
                else
                {
                    bombCasings.Push(bombCasings.Pop() - 5);
                }
            }

            if(madeBombsCount.All(kvp => kvp.Value >= 3))
            {
                Console.WriteLine("Bene! You have successfully filled the bomb pouch!");
            }
            else
            {
                Console.WriteLine("You don't have enough materials to fill the bomb pouch.");
            }

            if (bombEffects.Any())
            {
                Console.WriteLine($"Bomb Effects: {string.Join(", ",bombEffects)}");
            }
            else
            {
                Console.WriteLine("Bomb Effects: empty");
            }

            if (bombCasings.Any())
            {
                Console.WriteLine($"Bomb Casings: {string.Join(", ", bombCasings)}");
            }
            else
            {
                Console.WriteLine("Bomb Casings: empty");
            }

            madeBombsCount = madeBombsCount
                .OrderBy(kvp => kvp.Key)
                .ToDictionary(x => x.Key, y => y.Value);

            foreach (var kvp in madeBombsCount)
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value}");
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace _03._House_Party
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<string> listNames = new List<string>();
            for (int i = 0; i < n; i++)
            {
                string[] input = Console.ReadLine().Split();
                string name = input[0];
                if(input[2] == "going!")
                {
                    if (!listNames.Contains(name))
                    {
                    listNames.Add(name);
                    }
                    else
                    {
                        Console.WriteLine($"{name} is already in the list!");
                    }

                }
                else
                {
                    if (listNames.Contains(name))
                    {
                        listNames.Remove(name);
                    }
                    else
                    {
                        Console.WriteLine($"{name} is not in the list!");
                    }
                }
                

            }
            for (int i = 0; i < listNames.Count; i++)
            {
                Console.WriteLine(listNames[i]);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _08.Magic_Sum
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int magicNum = int.Parse(Console.ReadLine());
            for (int i = 0; i < arr.Length; i++)
            {
                for (int j = i+1; j < arr.Length; j++)
                {
                    if(arr[i] + arr[j] == magicNum)
                    {
                        Console.WriteLine($"{arr[i]} {arr[j]}");
                    }
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Gauss_trick
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            GausTrick(list);

        }
        static void GausTrick(List<int> list)
        { 

            for (int i = 0,j = list.Count-1; i < list.Count/2; i++, j--)
            {
                Console.Write($"{list[i] + list[j]} ");
            }
            if(list.Count % 2 != 0)
            {
                Console.Write(list[list.Count / 2]);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Inheritance
{
    public class Person
    {
        private int age;
        public string Name { get; set; }
        public string Address { get; set; }

        public override string ToString()
        {
            return $"{this.Name} - {this.age}";

        }
    }
}
<file_sep>﻿using System;

namespace _1st
{
    class Program
    {
        static void Main(string[] args)
        {
            int countBees = int.Parse(Console.ReadLine());
            int countFlowers = int.Parse(Console.ReadLine());

            double allHoney = countBees * countFlowers * 0.21;
            double countPiti = allHoney / 100;
            double unusedHoney = allHoney % 100;

            Console.WriteLine($"{Math.Floor(countPiti)} honeycombs filled.");
            Console.WriteLine($"{unusedHoney:F2} grams of honey left.");
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _4._Matrix_Shuffling
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] dimensions = Console.ReadLine()
                .Split(' ', StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();

            int rows = dimensions[0];
            int cols = dimensions[1];

            string[,] matrix = new string[rows, cols];

            for (int row = 0; row < rows; row++)
            {
                string[] currRow = Console.ReadLine()
                    .Split(' ', StringSplitOptions.RemoveEmptyEntries)
                   // .Select(int.Parse)
                    .ToArray();
                for (int col = 0; col < cols; col++)
                {
                    matrix[row, col] = currRow[col];
                }
            }


            while (true)
            {
                string command = Console.ReadLine();
                if(command == "END")
                {
                    break;
                }
                string[] cmdArgs = command.Split(' ', StringSplitOptions.RemoveEmptyEntries);
                if(cmdArgs[0] == "swap" && cmdArgs.Length == 5)
                {
                    int x1 = int.Parse(cmdArgs[1]);
                    int x2 = int.Parse(cmdArgs[2]);
                    int y1 = int.Parse(cmdArgs[3]);
                    int y2 = int.Parse(cmdArgs[4]);

                    if (!AreCoordinatesValid(x1, x2, y1, y2, rows, cols))
                    {
                        Console.WriteLine("Invalid input!");
                        continue;
                    }

                    string temp = matrix[x1, x2];
                    matrix[x1, x2] = matrix[y1, y2];
                    matrix[y1, y2] = temp;

                    for (int row = 0; row < rows; row++)
                    {
                        for (int col = 0; col < cols; col++)
                        {
                            Console.Write(matrix[row,col] + " ");
                        }
                        Console.WriteLine();
                    }

                }
                else
                {
                    Console.WriteLine("Invalid input!");
                }
                
            }
        }
        private static bool AreCoordinatesValid(int x1,int x2,int y1, int y2,int rowsLength,int colsLength)
        {
            if(x1 < 0 || x1 > rowsLength -1 || x2 < 0 || x2 > colsLength - 1
                || y1 < 0 || y1 > rowsLength - 1 || y2 < 0 || y2 > colsLength - 1)
            {
                return false;
            }
            return true;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _05._Count_Symbols
{
    class Program
    {
        static void Main(string[] args)
        {
           var dict = new Dictionary<char, int>();

            char[] text = Console.ReadLine().ToCharArray();
            //string text = Console.ReadLine();

            foreach (var symbol in text)
            {
                if (!dict.ContainsKey(symbol))
                {
                    dict[symbol] = 0;
                }
                dict[symbol]++;
            }

            dict = dict
                .OrderBy(kvp => kvp.Key)
                .ToDictionary(x => x.Key, y => y.Value);

            foreach (var kvp in dict)
            {
                Console.WriteLine($"{kvp.Key}: {kvp.Value} time/s");
            }
        }
    }
}
<file_sep>﻿using System;

namespace Vending_Machine
{
    class Program
    {
        static void Main(string[] args)
        {
            string command = Console.ReadLine();
            double totalMoney = 0;
            while(command != "Start")
            {
                double ins = double.Parse(command);
                if(ins == 0.1 || ins == 0.2 || ins == 0.5 || ins == 1 || ins == 2)
                {
                    totalMoney += ins;
                }
                else
                {
                    Console.WriteLine($"Cannot accept {ins}");
                }
                command = Console.ReadLine();
            }

            string command2 = Console.ReadLine();
            while(command2 != "End")
            {
                string product = command2;
                switch (product)
                {
                    case "Nuts":
                        if(totalMoney >= 2)
                        {
                            totalMoney -= 2;
                            Console.WriteLine($"Purchased {product.ToLower()}");
                        }
                        else
                        {
                            Console.WriteLine("Sorry, not enough money");
                        }
                        break;
                    case "Water":
                        if (totalMoney >= 0.7)
                        {
                            totalMoney -= 0.7;
                            Console.WriteLine($"Purchased {product.ToLower()}");
                        }
                        else
                        {
                            Console.WriteLine("Sorry, not enough money");
                        }
                        break;
                    case "Crisps":
                        if (totalMoney >= 1.5)
                        {
                            totalMoney -= 1.5;
                            Console.WriteLine($"Purchased {product.ToLower()}");
                        }
                        else
                        {
                            Console.WriteLine("Sorry, not enough money");
                        }
                        break;
                    case "Soda":
                        if (totalMoney >= 0.8)
                        {
                            totalMoney -= 0.8;
                            Console.WriteLine($"Purchased {product.ToLower()}");
                        }
                        else
                        {
                            Console.WriteLine("Sorry, not enough money");
                        }
                        break;
                    case "Coke":
                        if (totalMoney >= 1)
                        {
                            totalMoney -= 1;
                            Console.WriteLine($"Purchased {product.ToLower()}");
                        }
                        else
                        {
                            Console.WriteLine("Sorry, not enough money");
                        }
                        break;
                    default:
                        Console.WriteLine("Invalid product");
                        break;
                       
                } command2 = Console.ReadLine();
            }
            Console.WriteLine($"Change: {totalMoney:F2}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace _05.Students_2
{
    class Student
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public int Age { get; set; }
        public string HomeTown { get; set; }

    }
    class Program
    {
        static void Main(string[] args)
        {
            List<Student> students = new List<Student>();
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "end")
                {
                    break;
                }
                string[] info = input.Split();

                if (IsStudentExisting(students, info[0], info[1]))
                {
                    Student student = GetStudent(students, info[0], info[1]);
                    student.FirstName = info[0];
                    student.LastName = info[1];
                    student.Age = int.Parse(info[2]);
                    student.HomeTown = info[3];

                }
                else
                {
                    Student student = new Student();
                    student.FirstName = info[0];
                    student.LastName = info[1];
                    student.Age = int.Parse(info[2]);
                    student.HomeTown = info[3];

                    students.Add(student);
                }
            }
            string city = Console.ReadLine();
            for (int i = 0; i < students.Count; i++)
            {
                if (students[i].HomeTown == city)
                {
                    Console.WriteLine($"{students[i].FirstName} {students[i].LastName} is {students[i].Age} years old.");
                }
            }

        }
        static bool IsStudentExisting(List<Student> students,string firstName, string lastName)
        {
            foreach (Student student in students)
            {
                if(student.FirstName == firstName && student.LastName == lastName)
                {
                    return true;
                }
            }
            return false;
        }
        static Student GetStudent(List<Student> students , string firstName , string lastName)
        {
            Student existingStudent = null;
            foreach (Student student in students)
            {
                if (student.FirstName == firstName && student.LastName == lastName)
                {
                    existingStudent = student;
                }
            }
            return existingStudent;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Heroes
{
    public class HeroRepository
    {
        private readonly List<Hero> data;

        public HeroRepository()
        {
            this.data = new List<Hero>();
        }

        public int Count => this.data.Count;

        public void Add(Hero hero)
        {
            this.data.Add(hero);
        }
        public void Remove(string name)
        {
            this.data.Remove(this.data.FirstOrDefault(h => h.Name == name));
        }
        public Hero GetHeroWithHighestStrength()
        {
           // int maxItemStrength = this.data.Max(h => h.Item.Strength);
            return this.data.FirstOrDefault(h => h.Item.Strength == this.data.Max(he => he.Item.Strength));
        }
        public Hero GetHeroWithHighestAbility()
        {
            return this.data.FirstOrDefault(h => h.Item.Ability == this.data.Max(he => he.Item.Ability));

        }
        public Hero GetHeroWithHighestIntelligence()
        {
            return this.data.FirstOrDefault(h => h.Item.Intelligence == this.data.Max(he => he.Item.Intelligence));
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            for(int i = 0; i < this.Count; i++)
            {
                sb.AppendLine(this.data[i].ToString());
            }

            return sb.ToString().TrimEnd();
        }


    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P07.MilitaryElite.Exceptions
{
    public class InvalidMissionStateException : Exception
    {
        private const string DEF_MSG = "Invalid mission state";
        public InvalidMissionStateException()
            :base(DEF_MSG)
        {
        }

        public InvalidMissionStateException(string message)
            : base(message)
        {
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _08._Company_Users
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, List<string>> companies = new Dictionary<string, List<string>>();

            while (true)
            {
                string inp = Console.ReadLine();
                if(inp == "End")
                {
                    break;
                }
                string[] command = inp.Split(" -> ").ToArray();

                string companyName = command[0];
                string id = command[1];

                if (!companies.ContainsKey(companyName))
                {
                    companies[companyName] = new List<string>();
                }
                if (!companies[companyName].Contains(id))
                {
                    companies[companyName].Add(id);
                }

            }

            foreach (var kvp in companies.OrderBy(c => c.Key))
            {
                Console.WriteLine(kvp.Key);
                foreach (var id in kvp.Value)
                {
                    Console.WriteLine($"-- {id}");
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Salary
{
    class Program
    {
        static void Main(string[] args)
        {
            int nBrowsers = int.Parse(Console.ReadLine());
            int salary = int.Parse(Console.ReadLine());

            for(int i=0; i < nBrowsers; i++)
            {
                if (salary <= 0)
                {
                    break;
                }

                string nameBrowser = Console.ReadLine();
                if(nameBrowser == "Facebook")
                {
                    salary = salary - 150;
                }
                else if(nameBrowser == "Instagram")
                {
                    salary = salary - 100;
                }
                else if(nameBrowser == "Reddit")
                {
                    salary = salary - 50;
                }
            }
            if (salary <= 0)
            {
                Console.WriteLine("You have lost your salary.");
            }
            else
            {
                Console.WriteLine(salary);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace Lambda_Expressions
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[] { 1, 2, 3, 4, 5 };
            ///with Select
            int[] arrayByFive = arr
                .Select(x => x*5)
                .ToArray();
            ///with Where
            ///
            
            Console.WriteLine(string.Join(" ", arrayByFive));

             
        }
    }
}
<file_sep>﻿using System;
using System.Diagnostics.Tracing;
using System.IO;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;

namespace _02.LineNumbers
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] lines = File.ReadAllLines("text.txt");

            for(int i = 0; i < lines.Length; i++)
            {
                string currLine = lines[i];

                int lettersCnt = CountOfLetters(currLine);
                int marksCnt = CountOfPunctuonalMarks(currLine);

                lines[i] = $"Line {i + 1}: {currLine} ({lettersCnt})({marksCnt})";

            }

            File.WriteAllLines("../../../output.txt", lines);

        }
        static int CountOfLetters(string line)
        {
            int cnt = 0;

            for (int i = 0; i < line.Length; i++)
            {
                char currChar = line[i];
                if (char.IsLetter(currChar))
                {
                    cnt++;
                }
            }
            return cnt;
        }
        static int CountOfPunctuonalMarks(string line)
        {
            char[] marks = { '-', ',', '.', '!', '?' };

            int cnt = 0;

            for (int i = 0; i < line.Length; i++)
            {
                char curChar = line[i];
                if (marks.Contains(curChar))
                {
                    cnt++;
                }
            }

            return cnt;
        }
        
    }
}
<file_sep>﻿using System;

namespace Change_Bureau
{
    class Program
    {
        static void Main(string[] args)
        {
            double bit = double.Parse(Console.ReadLine());
            double chin = double.Parse(Console.ReadLine());
            double komis = double.Parse(Console.ReadLine());

            double resInLev = bit * 1168 + chin * 0.15 * 1.76;
            resInLev = resInLev-(resInLev * (komis / 100));
            double resInEvro = resInLev / 1.95;
            Console.WriteLine($"{resInEvro:F2}");
        }
    }
}
<file_sep>﻿using P01.Vehicles.Common;
using P01.Vehicles.Models.Contracts;
using System;
using System.Collections.Generic;
using System.Text;

namespace P01.Vehicles.Models
{
    public  abstract class Vehicle : IDriveable, IRefueable
    {
        private double fuelquantity;
        private double tankCapacity;
        public Vehicle(double fuelquantity,double fuelconsumption,double tankCapacity)
        {
            this.FuelQuantity = fuelquantity > tankCapacity ? 0 : fuelquantity;
            this.FuelConsumption = fuelconsumption;
            this.TankCapacity = tankCapacity;
        }


        public double FuelQuantity 
        {
            get
            {
                return this.fuelquantity;
            }
            protected set 
            {                    
               //if(value < 0)
               //{
               //    throw new InvalidOperationException(ExceptionMessage.FuelIsNegativeOrZero);
               //}
                    this.fuelquantity = value;               
                
            } 
        }
        public virtual double FuelConsumption { get; protected set; }
        public double TankCapacity {
            get
            {
                return this.tankCapacity;
            }
            private set
            {
                this.tankCapacity = value;
            }
        }


        public virtual string Drive(double kilometers)
        {
            double fuelNeeded = kilometers * this.FuelConsumption;

            if(this.FuelQuantity < fuelNeeded)
            {
                throw new InvalidOperationException(string
                    .Format(ExceptionMessage.NotEnoughFuelExceptionMessage
                    ,this.GetType().Name));
            }

            this.FuelQuantity -= fuelNeeded;
                return $"{this.GetType().Name} travelled {kilometers} km";
            
        }

        public virtual void Refuel(double liters)
        {
            //if()
            if(liters > 0)
            {             
                if(this.FuelQuantity + liters > this.TankCapacity)
                {
                    string exc = string.Format(ExceptionMessage
                        .InvalidFuelTankExceptionMessage, liters);
                    throw new InvalidOperationException(exc);
                }
                this.FuelQuantity += liters;
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessage.FuelIsNegativeOrZero);
            }

        }
        public string DriveEmpty(double kilometers)
        {
            return this.Drive(kilometers);
        }
        public override string ToString()
        {
            return $"{this.GetType().Name}: {this.FuelQuantity:F2}";
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace Stacks_and_Queues_Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            var myStack = new Stack<string>();

            myStack.Push("First");
            myStack.Push("Second");
            myStack.Push("Third");

            Console.WriteLine(myStack.Peek());
            Console.WriteLine(myStack.Peek());

            var stack = new Stack<int>();



        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _09._ForceBook__My_solution_
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<string, List<string>> book = new Dictionary<string, List<string>>();

            while (true)
            {
                string inp = Console.ReadLine();
                if(inp == "Lumpawaroo")
                {
                    break;
                }
                string[] inputArgs = inp
                    .Split(new string[] { " | ", " -> " }, StringSplitOptions.RemoveEmptyEntries);
                if(inp.Contains("|"))
                {
                    string side = inputArgs[0];
                    string user = inputArgs[1];
                    AddUser(book, side, user);
                }
                else
                {
                    string side = inputArgs[1];
                    string user = inputArgs[0];
                    MoveUser(book, side, user);
                }
            }

            book = book
                .Where(kvp => kvp.Value.Count>0)
               .OrderByDescending(kvp => kvp.Value.Count)
               .ThenBy(kvp => kvp.Key)
               .ToDictionary(a => a.Key, b => b.Value);

            foreach (var side in book)
            {
                Console.WriteLine($"Side: {side.Key}, Members: {side.Value.Count}");
                foreach (var user in side.Value.OrderBy(u =>u))
                {
                    Console.WriteLine($"! {user}");
                }
            }
            
        }

        private static void MoveUser(Dictionary<string, List<string>> book, string side, string user)
        {
            if (book.Any(b => b.Value.Contains(user)))
            {
                foreach (var kvp in book)
                {
                    if (kvp.Value.Contains(user))
                    {
                        kvp.Value.Remove(user);
                    }
                }
            }
            if (!book.ContainsKey(side))
            {
                book[side] = new List<string>();
            }

            book[side].Add(user);
            Console.WriteLine($"{user} joins the {side} side!");
        }

        private static void AddUser(Dictionary<string, List<string>> book, string side, string user)
        {
            if (!book.ContainsKey(side))
            {
                book[side] = new List<string>();
            }
            if (!book.Any(b => b.Value.Contains(user)))
            {
                book[side].Add(user);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace _05.Students_2
{
    class Student
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public int Age { get; set; }
        public string HomeTown { get; set; }

    }
    class Program
    {
        static void Main(string[] args)
        {
            List<Student> list = new List<Student>();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end")
                {
                    break;
                }
                string[] info = input.Split();

                Student student = new Student();
                student.FirstName = info[0];
                student.LastName = info[1];
                student.Age = int.Parse(info[2]);
                student.HomeTown = info[3];

                list.Add(student);
            }
            string city = Console.ReadLine();
            for (int i = 0; i < list.Count; i++)
            {
                if(list[i].HomeTown == city)
                {
                    Console.WriteLine($"{list[i].FirstName} {list[i].LastName} is {list[i].Age} years old.");
                }
            }

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;

namespace _03._Inventory
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> inventory = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).ToList();

            string input;
            while((input = Console.ReadLine()) != "Craft!")
            {
                string[] command = input.Split(" - ", StringSplitOptions.RemoveEmptyEntries).ToArray();

                if(command[0] == "Collect")
                {
                    string itemToAdd = command[1];
                    if(!inventory.Any(item => item == itemToAdd))
                    {
                        inventory.Add(itemToAdd);
                    }
                }
                else if(command[0] == "Drop")
                {
                    string itemToRemove = command[1];
                    if (inventory.Any(item => item == itemToRemove))
                    {
                        inventory.Remove(itemToRemove);
                    }
                }
                else if(command[0] == "Combine Items")
                {
                    string[] items = command[1].Split(":", StringSplitOptions.RemoveEmptyEntries).ToArray();
                    string oldItem = items[0];
                    string newItem = items[1];
                    int indexOfOldItem;
                    if((indexOfOldItem = inventory.FindIndex(item => item == oldItem)) != -1)
                    {
                        inventory.Insert(indexOfOldItem + 1, newItem);
                    }
                }
                else
                {
                    string itemToRenew = command[1];
                    if (inventory.Any(item => item == itemToRenew))
                    {
                        inventory.Remove(itemToRenew);
                        inventory.Add(itemToRenew);
                    }

                }
            }

            Console.WriteLine(string.Join(", ", inventory));
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;

namespace Polymorphism
{
    public class Truck : Vehicle
    {
        public int MaxLoad { get; set; }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace P01.ClubParty
{
    class Program
    {
        static void Main(string[] args)
        {
            int hallsMaxCapacity = int.Parse(Console.ReadLine());

            string[] input = Console.ReadLine().Split();

            Stack<string> inputLines = new Stack<string>(input);

            Dictionary<char, List<int>> hallsAndPeople = new Dictionary<char, List<int>>();

            Queue<char> halls = new Queue<char>();

            while (inputLines.Any())
            {
                char hallName;
                char.TryParse(inputLines.Peek(), out hallName);
                if (char.IsLetter(hallName))
                {
                    hallName = char.Parse(inputLines.Pop());

                    halls.Enqueue(hallName);
                    hallsAndPeople[hallName] = new List<int>();
                }
                else
                {
                    if (halls.Any())
                    {
                        char currHall = halls.Peek();
                        int peopleToJoin = int.Parse(inputLines.Peek());
                        if (hallsAndPeople[currHall].Sum() + peopleToJoin == hallsMaxCapacity)
                        {
                            hallsAndPeople[currHall].Add(peopleToJoin);
                            halls.Dequeue();
                            inputLines.Pop();
                            PrintHall(hallsAndPeople, currHall);
                        }
                        else if (hallsAndPeople[currHall].Sum() + peopleToJoin > hallsMaxCapacity)
                        {
                            halls.Dequeue();
                            PrintHall(hallsAndPeople, currHall);
                        }
                        else
                        {
                            hallsAndPeople[currHall].Add(peopleToJoin);
                            //halls.Dequeue();
                            inputLines.Pop();
                        }
                    }
                    else
                    {
                        inputLines.Pop();
                    }

                }
            }
        }

        private static void PrintHall(Dictionary<char, List<int>> hallsAndPeople, char currHall)
        {
            Console.WriteLine($"{currHall} -> " +
                                        $"{string.Join(", ", hallsAndPeople[currHall])}");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Globalization;

namespace Class
{
    class Program
    {
        static void Main(string[] args)
        {
            //string[] myArray = new string[10];
            //myArray.Length;
            
            // var birthday = new { day = 22, month = 6 , year = 1990};////Making class on one line

            //Cat cat = new Cat();
            //cat.Name = "Maca";
            //Console.WriteLine(cat.Name);

            string input = "07-13-2020";
          //  DateTime dateTime = DateTime.Parse(input);
            DateTime dateTime = DateTime.ParseExact(input, "MM-dd-yyyy", CultureInfo.InvariantCulture);


            dateTime = dateTime.AddDays(2);

            Console.WriteLine(dateTime.DayOfWeek);
            ////////////////////////////
            ///

            Cat cat = new Cat();
            cat.Eat(); 

            Console.WriteLine(cat.Fat);

            ///////////
            ///CONSTRUCTORS
          //  var list = new List<string>(20);

            Cat cat2 = new Cat();
            
            cat2.Kittens.Add("Maci");
            //cat2.Kittens = new List<string>(); WITHOUT CONSTUCTOR

            foreach (var name in cat2.Kittens)
            {
                Console.WriteLine(name);
            }
            ////////////////////
            ///

            //// List<Cat>



        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _05._Bomb_Numbers
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int bombNum = input[0];
            int bombPower = input[1];
            list = Detonate(list, bombNum, bombPower);
            Console.WriteLine(list.Sum());

        }
        static List<int> Detonate(List<int> list,int bombNum,int bombPower)
        {
            int index = 0;
            while (list.Contains(bombNum))
            {
                index = list.IndexOf(bombNum);
                int leftRange = bombPower;
                int rightRange = bombPower;
                if(index - leftRange < 0)
                {
                    leftRange = index;
                }
                if(index + rightRange >= list.Count)
                {
                    rightRange = list.Count - index - 1;
                }
                list.RemoveRange(index - leftRange, leftRange + rightRange + 1);
            }
            return list;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Class
{
    class Cat
    {
        //public string Name{ get; set;}

        //public string breed { get; set; }

        //public int age { get; set; }
        public Cat()//string name
        {
            //Name = name;///WHEN YOU TYPE SOME PARAMETER OF THE CONSTRUCTOR YOU SHOULD SET THE VALUE 
            //OR YOU DONT DO ANYTHING WITH IT (LIKE HERE)

            ///INICIALISING THE LIST IN THE CONSTRUCTOR SO WE DONT DO IT IN PROGRAM.CS
            ///BECAUSE OF THIS THE CONSTRUCTOR IS HELPFUL
            Kittens = new List<string>();
        }

        public string Name { get; set; }

        public List<string> Kittens { get; set; }

        public int Age { get; set; }
        public double Fat { get; set; }
        public void Eat()
        {
            Fat += 200;
        }

    }
}
 <file_sep>﻿using System;

namespace FruitShop
{
    class Program
    {
        static void Main(string[] args)
        {
            string fruit = Console.ReadLine();
            string day = Console.ReadLine();
            double count = double.Parse(Console.ReadLine());
            double result = 0;

            switch (day)
            {
                case "Monday":
                case "Tuesday":                  
                case "Wednesday":
                case "Thursday":                   
                case "Friday":
                 
                    switch(fruit)
                    {
                        case "banana":
                            result = 2.50 * count;
                            break;
                        case "apple":
                            result = 1.20 * count;
                            break;
                        case "orange":
                            result = 0.85 * count;
                            break;
                        case "grapefruit":
                            result = 1.45 * count;
                            break;
                        case "kiwi":
                            result = 2.70 * count;
                            break;
                        case "pineapple":
                            result = 5.50 * count;
                            break;
                        case "grapes":
                            result = 3.85 * count;
                            break;
                        default:
                            Console.WriteLine("error");
                            break;
                    }
                    break;
                case "Saturday":
                case "Sunday":
                    switch (fruit)
                    {
                        case "banana":
                            result = 2.70 * count;
                            break;
                        case "apple":
                            result = 1.25 * count;
                            break;
                        case "orange":
                            result = 0.90 * count;
                            break;
                        case "grapefruit":
                            result = 1.60 * count;
                            break;
                        case "kiwi":
                            result = 3.00 * count;
                            break;
                        case "pineapple":
                            result = 5.60 * count;
                            break;
                        case "grapes":
                            result = 4.20 * count;
                            break;
                        default:
                            Console.WriteLine("error");
                            break;
                    }
                    break;
                default:
                    Console.WriteLine("error");
                    break;

            }
            if (result != 0)
            {
                Console.WriteLine($"{result:f2}");
            }
            
           

        }
    }
}
<file_sep>﻿using System;
using System.Linq;

namespace _1._Diagonal_Difference
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int[,] matrix = new int[N, N];

            

            for (int row = 0; row < matrix.GetLength(0); row++)
            {
                int[] currRow = Console.ReadLine()
                    .Split()
                    .Select(int.Parse)
                    .ToArray();
                for (int col = 0; col < matrix.GetLength(1); col++)
                {
                    matrix[row, col] = currRow[col];
                }
            }
            
            int diag1 = 0;

            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    if(row == col)
                    {
                        diag1 += matrix[row,col];
                    }
                    
                }
            }

            int diag2 = 0;
            for (int i = N - 1; i >= 0; i--)
            {
                int row = N - i - 1;
                int col = i;
                diag2 += matrix[row,col];
            }


            Console.WriteLine(Math.Abs(diag1 - diag2));


        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace StackSum
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToArray();

            var stack = new Stack<int>(numbers);

            while(true)
            {
                string[] command = Console.ReadLine()
                    .ToLower()
                    .Split();
                if (command[0] == "add")
                {
                    stack.Push(int.Parse(command[1]));
                    stack.Push(int.Parse(command[2]));

                }
                else if (command[0] == "remove")
                {
                    int totalElementsToRemove = int.Parse(command[1]);

                    if (stack.Count >= totalElementsToRemove)
                    {

                        for (int i = 0; i < totalElementsToRemove; i++)
                        {
                            if (stack.Any())
                            {
                                stack.Pop();
                            }
                        }
                    }
                }
                else
                {
                    break;
                }
            }
            Console.WriteLine($"Sum:{stack.Sum()} ");
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace RemoveNegativesAndReverse
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            list = RemoveNegativesAndReverse(list);
            if(list.Count == 0)
            {
                Console.WriteLine("empty");
            }
            else
            {
                Console.WriteLine(string.Join(" ", list));
            }

        }
        static List<int> RemoveNegativesAndReverse(List<int> list)
        {
            List<int> resList = new List<int>();
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] > 0)
                {
                    resList.Add(list[i]);
                }
            }
            resList.Reverse();
            return resList;
        }
    }
}
<file_sep>using CarManager;
using NUnit.Framework;
using NUnit.Framework.Constraints;
using System;

namespace Tests
{
    public class CarTests
    {
        private Car car;
        [SetUp]
        public void Setup()
        {
        }

        [Test]
        public void ConstructorInitEverything()
        {
            string make = "Mercedes";
            string model = "Amg";
            double fuelCons = 3;
            double capacity = 100;

            car = new Car(make, model, fuelCons, capacity);

            Assert.AreEqual(make, car.Make);
            Assert.AreEqual(model, car.Model);
            Assert.AreEqual(fuelCons, car.FuelConsumption);
            Assert.AreEqual(capacity, car.FuelCapacity);
        }
        [TestCase("","Amg",3,100)]
        [TestCase("Mercedes", "", 3, 100)]
        [TestCase("Mercedes", "Amg", -3, 100)]
        [TestCase("Mercedes", "Amg", 0, 100)]
        [TestCase("Mercedes", "Amg", 3, 0)]
        [TestCase("Mercedes", "Amg", 3, -100)]
        public void ConstructorInicializingExcpetions(string make, string model,
            double fuelConsumption, double fuelCapacity)
        {
            Assert.Throws<ArgumentException>(() =>
            {
                car = new Car(make, model, fuelConsumption, fuelCapacity);
            });
        }
        //[Test]
        //public void FuelAmountShouldThrowExceptionIfItsLowerThanZero()
        //{

        //}





        [TestCase(-3)]
        [TestCase(0)]
        public void RefuelShouldThrowExceptionIfItIsGivenZeroOrSmallerNumber(double fuelToRefuel)
        {
            car = new Car("Mercedes", "Amg", 3, 100);

            Assert.Throws<ArgumentException>(() =>
            {
                car.Refuel(fuelToRefuel);
            });
        }
        [Test]
        public void RefuelShouldIncreaseFuelAmountByGiven()
        {
            car = new Car("Mercedes", "Amg", 3, 100);
            double expectedFuelAmount = 10;

            car.Refuel(10);

            Assert.AreEqual(expectedFuelAmount, car.FuelAmount);
            
        }
        [Test]
        public void RefuelShouldNotIncreaseOverTheCapacity()
        {
            car = new Car("Mercedes", "Amg", 3, 100);
            double expectedFuel = 100;

            car.Refuel(110);

            Assert.AreEqual(expectedFuel, car.FuelAmount);
        }
        [Test]
        public void DriveShouldThrowExceptionIfItDoesntHaveEnoughFuel()
        {
            car = new Car("Mercedes", "Amg", 3, 100);

            Assert.Throws<InvalidOperationException>(() =>
            {
                car.Drive(23);
            });
        }
        [Test]
        public void DriveShouldDecreaseFuelAmountCorrectly()
        {
            car = new Car("Mercedes", "Amg", 3, 100);
            double expectedFuelLeft = 97;
            car.Refuel(100);

            car.Drive(100);

            Assert.That(expectedFuelLeft, Is.EqualTo(car.FuelAmount));
        }

    }
}<file_sep>﻿using System;

namespace _1.Train
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] train = new int[n];
            int sumPeople = 0;
            for (int i = 0; i < train.Length; i++)
            {
                train[i] = int.Parse(Console.ReadLine());
                sumPeople += train[i];
            }

            foreach (var item in train)
            {
                Console.Write($"{item} ");
            }
            Console.WriteLine();
            Console.WriteLine(sumPeople);
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cars
{
    public class Tesla : Car,IElectricCar
    {
        public Tesla(string model , string color)
            :base(model,color)
        {
            
        }
        public Battery Battery { get; set; }

        
        public override string Start()
        {
            return "Tesla does not make any noise.";
        }

       
    }
}
<file_sep>﻿using System;
using System.Text.RegularExpressions;

namespace Match_All_Words
{
    class Program
    {
        static void Main(string[] args)
        {
            Regex regex = new Regex(@"\d{2}(\W)\w{3}\1[0-9]{4}");



            MatchCollection matches= regex.Matches(@"30.Dec.1994 30/Dec/1994 33-Jul-1995.");
            

            bool matches2 = regex.IsMatch(@"30.Dec.1994 30/Dec/1994 33-Jul-1995.");
            Console.WriteLine(matches2);
            Console.WriteLine(matches.Count);
            foreach (Match match in matches)
            {
                Console.WriteLine(match.Value);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace P04.PizzaCalories.Core
{
    public class Engine
    {
        public static void Run()
        {

        }
    }
}
<file_sep>﻿using System;

namespace Sum_Prime_Non_Prime
{
    class Program
    {
        static void Main(string[] args)
        {
           string command = Console.ReadLine();

            int primeSum = 0;
            int nonprimeSum = 0;
            bool is_non_prime = false;
           while(command!="stop")
            {
                int number = int.Parse(command);
                if(number<0)
                {
                    Console.WriteLine("Number is negative.");
                    command = Console.ReadLine();
                    continue;
                }
                for(int i=2;i<number;i++)
                {
                    if(number%i==0)
                    {
                        is_non_prime = true;
                        break;
                    }
                }
                if(is_non_prime && number!= 1)
                {
                     nonprimeSum += number;
                    is_non_prime = false;
                }
                else
                {
                   primeSum += number; 
                }


                 
                command = Console.ReadLine();
            }
            Console.WriteLine($"Sum of all prime numbers is: {primeSum}");
            Console.WriteLine($"Sum of all non prime numbers is: {nonprimeSum}");
        }
    }
}
<file_sep>﻿using System;
using System.Runtime.InteropServices;

namespace _02._Snake
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            char[,] field = new char[N, N];
            InitField(N, field);

            int snakeRow = -1;
            int snakeCol = -1;
            FindingSnakeCoordinates(N, field, ref snakeRow, ref snakeCol);

            int foodQuantity = 0;
            bool isOut = false;
            while (foodQuantity < 10 && isOut == false)
            {
                string command = Console.ReadLine();
                field[snakeRow, snakeCol] = '.';
                if (command == "up")
                {
                    if (snakeRow - 1 < 0)
                    {
                        isOut = true;
                        continue;
                    }
                    CheckingPositionChar(field, snakeRow - 1, snakeCol, ref foodQuantity, N,ref snakeRow,ref snakeCol);

                    //snakeRow -= 1;

                }
                else if (command == "down")
                {
                    if (snakeRow + 1 == N)
                    {
                        isOut = true;
                        continue;
                    }
                    CheckingPositionChar(field, snakeRow + 1, snakeCol, ref foodQuantity, N, ref snakeRow, ref snakeCol);

                    //snakeRow += 1;
                }
                else if (command == "left")
                {
                    if (snakeCol - 1 < 0)
                    {
                        isOut = true;
                        continue;
                    }
                    CheckingPositionChar(field, snakeRow, snakeCol - 1, ref foodQuantity, N, ref snakeRow, ref snakeCol);

                    //snakeCol -= 1;
                }
                else if (command == "right")
                {
                    if (snakeCol + 1 == N)
                    {
                        isOut = true;
                        continue;
                    }
                    CheckingPositionChar(field, snakeRow, snakeCol + 1, ref foodQuantity, N, ref snakeRow, ref snakeCol);

                    //snakeCol += 1;
                }
               // PrintMatrix(N, field);
            }
            if (isOut)
            {
                Console.WriteLine("Game over!");
            }
            else
            {
                Console.WriteLine("You won! You fed the snake.");
            }

            Console.WriteLine($"Food eaten: {foodQuantity}");

            PrintMatrix(N, field);
        }

        private static void PrintMatrix(int N, char[,] field)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    Console.Write(field[row, col]);
                }
                Console.WriteLine();
            }
        }

        private static void CheckingPositionChar(char[,] field,int row,int col,
            ref int foodQuantity,int N,ref int snakeRow,ref int snakeCol)
        {
            if (field[row, col] == '*')
            {
                foodQuantity++;
                field[row, col] = 'S';
                snakeRow = row;
                snakeCol = col;
            }
            else if(field[row,col] == 'B')
            {
                field[row, col] = '.';
                int burrowRow = -1;
                int burrowCol = -1;
                for (int row2 = 0; row2 < N; row2++)
                {
                    for (int col2 = 0; col2 < N; col2++)
                    {
                        if(field[row2,col2] == 'B')
                        {
                            burrowRow = row2;
                            burrowCol = col2;
                            break;
                        }
                    }
                }
                field[burrowRow, burrowCol] = 'S';
                //////
                snakeRow = burrowRow;
                snakeCol = burrowCol;
            }
            else
            {

                field[row, col] = 'S';
                snakeRow = row;
                snakeCol = col;
            }
        }

        private static void FindingSnakeCoordinates(int N, char[,] field, ref int snakeRow, ref int snakeCol)
        {
            for (int row = 0; row < N; row++)
            {
                for (int col = 0; col < N; col++)
                {
                    if (field[row, col] == 'S')
                    {
                        snakeRow = row;
                        snakeCol = col;
                    }
                }
            }
        }

        private static void InitField(int N, char[,] field)
        {
            for (int row = 0; row < N; row++)
            {
                string currRow = Console.ReadLine();
                for (int col = 0; col < N; col++)
                {
                    field[row, col] = currRow[col];
                }
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Polymorphism
{
    public interface IVehicle
    {
        string Model { get; }

        string VrumVrum();
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;

namespace Stack_of_Strings
{
    class Program
    {
        static void Main(string[] args)
        {

            var hashSet = new HashSet<int>();

            hashSet.AddRange(new[] { 2, 3, 4 });

            var list = new List<string>();

            var isEmpty = list.IsEmpty();

            var dict = new Dictionary<int, string>();


            dict.IsEmpty();





            //var myCoolStack = new StackOfStrings();

            //myCoolStack.AddRange(new List<string> { "Ivan", "Pesho" });
            //myCoolStack.AddRange(new string[] { "<NAME>", "<NAME>" });
           // myCoolStack.AddRange(new Stack<string>())
        }
    }
}
<file_sep>﻿using System;

namespace Class_Inheritance
{
    ///sealed class Vehicle /// doesn't allow this class to be inherited - sealed 
     class Vehicle
    {
        public string brand = "Ford";
        public void honk()
        {
            Console.WriteLine("BEEP BEEP");
        }

    }
    class Car : Vehicle
    {
        public string modelName = "Mustang";

    }
    class Program
    {
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.honk();
            Console.WriteLine($"{myCar.brand} {myCar.modelName}");
           
        }
    }
}
<file_sep>﻿using P04.WildFarm.Models.Foods;
using System;
using System.Collections.Generic;
using System.Text;

namespace P04.WildFarm.Models.Animals.Mammals
{
    public class Mouse : Mammal
    {
        private const double WEIGHT_MULT = 0.10;
        public Mouse(string name, double weight, string livingRegion)
            : base(name, weight, livingRegion)
        {
        }

        public override double WeightMultiplier => WEIGHT_MULT;

        public override ICollection<Type> PrefferedFoods =>
            new List<Type>() { typeof(Vegetable), typeof(Fruit) };

        public override void ProduceSound()
        {
            Console.WriteLine("Squeak");
        }
        public override string ToString()
        {
            return base.ToString() + $" {this.Weight}, { this.LivingRegion}, { this.FoodEaten}]";
        }
    }
}
<file_sep>﻿using P03.ShoppingSpree.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace P03.ShoppingSpree.Models
{
    public class Person
    {
        private string name;
        private decimal money;
        private List<Product> bag;

        private Person()
        {
            this.bag = new List<Product>();
        }
        public Person(string name , decimal money) 
            : this()
        {
            this.Name = name;
            this.Money = money;
        }

        public string Name
        {
            get
            {
                return this.name;
            }
            private set
            {
                if (string.IsNullOrWhiteSpace(value))
                {
                    throw new ArgumentException(GlobalConstants.InvalidNameExceptionMessage);
                }

                this.name = value;
            }
        }

        public decimal Money
        {
            get
            {
                return this.money;
            }
            private set
            {
                if (value < 0)
                {
                    throw new ArgumentException(GlobalConstants.InvalidMoneyException);
                }

                this.money = value;
            }
        }

        public IReadOnlyCollection<Product> Bag
        {
            get
            {
                return this.bag;
                ///asReadOnly
            }
        }

        public void BuyProduct(Product product)
        {
            if(this.Money < product.Cost)
            {   
                throw new InvalidCastException($"{this.Name} can't afford {product.Name}");
            }
            else
            {
               // Console.WriteLine($"{this.Name} bought {this.Name}");
                this.Money -= product.Cost;
                this.bag.Add(product);
                
            }
        }

        public override string ToString()
        {
            string productsOutput = this.Bag.Count > 0 ?
                String.Join(", ", this.Bag) : "Nothing bought";


            return $"{this.Name} - {productsOutput}";
        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _05.Multiply_Big_Number
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] firstNum = Console.ReadLine()
                .ToCharArray();
            int multiplier = int.Parse(Console.ReadLine());
            if(multiplier == 0)
            {
                Console.WriteLine(0);
                return;
            }

            StringBuilder sb = new StringBuilder(); 
            int remainder = 0;

            for (int i = firstNum.Length - 1; i >= 0; i--)
            {
                char currentCh = firstNum[i];
                int currNum = int.Parse(currentCh.ToString());

                int sum = (currNum * multiplier) + remainder;
                sb.Append(sum % 10);
                remainder = sum / 10;
                

            }
            if(remainder != 0)
            {
            sb.Append(remainder);
            }

            List<char> result = sb.ToString().Reverse()
                .ToList();


            RemoveTrailingZeros(result);

            Console.WriteLine(string.Join("", result));
        }
        private static void RemoveTrailingZeros(List<char> resultArr)
        {
           
                if(resultArr[0] == '0')
                {
                    int endIndex = 0;

                    for (int j = 1; j < resultArr.Count; j++)
                    {
                        if(resultArr[j] != '0')
                         {
                            endIndex = j;
                         }   
                    }

                for (int i = 0; i < endIndex; i++)
                {
                    resultArr.RemoveAt(0);
                }
                }

                
            
        }
    }
}
<file_sep>﻿using System;

namespace ToyShop
{
    class Program
    {
        static void Main(string[] args)
        {
            double excursionPrize = double.Parse(Console.ReadLine());
            int countPuzzels = int.Parse(Console.ReadLine());
            int countDolls = int.Parse(Console.ReadLine());
            int countBear = int.Parse(Console.ReadLine());
            int countMinions = int.Parse(Console.ReadLine());
            int countTrucks = int.Parse(Console.ReadLine());

            double result = countPuzzels * 2.60 + countDolls * 3 + countBear * 4.10 + countMinions * 8.20 + countTrucks * 2;

          //  Console.WriteLine(result);

            int countEverything = countPuzzels + countDolls + countBear + countMinions + countTrucks;
           // Console.WriteLine(countEverything);
            if (countEverything>= 50)
            {
                result = result - result * 0.25; 
            }

            result = result - result * 0.1;

            //Console.WriteLine(result); 
             

            if (result >= excursionPrize)
            {
                Console.WriteLine($"Yes! {result - excursionPrize:F2} lv left.");
            }
            else
            {
                Console.WriteLine($"Not enough money! {excursionPrize - result:F2} lv needed."); 
            }


                
         
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Class
{
    public class Shop
    {
        public List<string> Items { get; set; }

        public decimal Price { get; set; }
       
        public decimal TotalPrice 
        {
            get
            {
                return this.Items.Count * Price;
            }

            // return this.Item
        }

    }
}
<file_sep>﻿using System;

namespace MaxNumber
{
    class Program
    {
        static void Main(string[] args)
        {
            string command = Console.ReadLine();
            int max = int.MinValue;
            while(command != "Stop")
            {
                int num = int.Parse(command);
                if(num > max)
                {
                    max = num;
                }
                command = Console.ReadLine();
            }
            Console.WriteLine(max);
        }
    }
}
<file_sep>﻿using System;

namespace _03._Characters_in_Range
{
    class Program
    {
        static void Main(string[] args)
        {
            char start = char.Parse(Console.ReadLine());
            char end = char.Parse(Console.ReadLine());
            PrintCharactersInRange(start, end);
        }
        static void PrintCharactersInRange(char start , char end)
        {
            int IntStart = (int)start;
            int IntEnd = (int)end;
            //Console.WriteLine(IntStart);
            //Console.WriteLine(IntEnd);
            if (IntStart < IntEnd)
            {
                for (int i = IntStart + 1; i < IntEnd; i++)
                {
                    Console.Write($"{(char)i} ");
                }
            }
            else
            {
                for (int i = IntEnd + 1; i < IntStart; i++)
                {
                    Console.Write($"{(char)i} ");
                }
            }

        }
    }
}
<file_sep>﻿using P03.Telephony.Contracts;
using P03.Telephony.Exceptions;
using P03.Telephony.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P03.Telephony.Core
{
    class Engine : IEngine
    {
        public void Run()
        {
            string[] phoneNumbers = Console.ReadLine()
                .Split()
                .ToArray();
            string[] sites = Console.ReadLine()
                .Split()
                .ToArray();

            StationaryPhone stationaryPhone = new StationaryPhone();
            Smartphone smartphone = new Smartphone();

            CallNumbers(phoneNumbers, stationaryPhone, smartphone);
            BrowseSites(sites, smartphone);

        }

        private static void BrowseSites(string[] sites, Smartphone smartphone)
        {
            foreach (var url in sites)
            {
                try
                {
                    Console.WriteLine(smartphone.Browse(url));
                }
                catch (InvalidUrlException iue)
                {
                    Console.WriteLine(iue.Message);
                }
            }
        }

        private static void CallNumbers(string[] phoneNumbers, StationaryPhone stationaryPhone, Smartphone smartphone)
        {
            foreach (var number in phoneNumbers)
            {
                try
                {
                    if (number.Length == 7)
                    {
                        Console.WriteLine(stationaryPhone.Call(number));
                    }
                    else if (number.Length == 10)
                    {
                        Console.WriteLine(smartphone.Call(number));
                    }
                    else
                    {
                        throw new InvalidNumberException();
                    }

                }
                catch (InvalidNumberException ine)
                {

                    Console.WriteLine(ine.Message);
                }

            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Net.Mail;
using System.Text;

namespace Encapsulation
{
    public class Person
    {
        private string firstName;
        private string lastName;
        private int age;
        private decimal salary;
        public Person()
        {

        }

        public Person(string firstname, string lastName, int age )
        {
            this.FirstName = firstname;
            this.LastName = LastName;

            this.Age = age;
        }

        public string FirstName
        {
            get
            {
               return  this.firstName;
            }
            internal set
            {
                CommonValidator.ValidateNull(value, "Person first name");
                this.firstName = value;
            }
        }
        public string LastName
        {
            get
            {
                return this.lastName;
            }
            internal set
            {
                if (value == null)
                {
                    throw new InvalidOperationException("Person Last name cannot be null");
                }
                //CommonValidator.ValidateNull(value, nameof(Person), nameof(this.LastName));

                this.lastName = value;
            }
        }
        public int Age 
        {
            get
            {
                return this.age;
            }
            internal set
            {
                //if(value < 30)
                //{
                //    throw new InvalidOperationException("Invalid age.");
                //}
                CommonValidator.ValidateMin(value, 0, nameof(Person), nameof(Person.Age));

                this.age = value;
            }
        }
        public string Gender { get; internal set; }
        public DateTime BirthDay { get; internal set; }

        public decimal Salary
        {
            get
            {
                return this.salary; 
            }
            internal set
            {
                CommonValidator.ValidateMin(value, 460, nameof(Person), nameof(this.Salary));
                this.salary = value;
            }
        }

        public Person RegisterForExam()
        {
            //Logic registration
            return this;
        }

        public Person ParticipateInExam()
        {
            //Logic participation
            return this;
        }

        public Person CalculateScore()
        {
            //Logic Score
            return this;
        }

        public override string ToString()
        {
            return $"{this.FirstName} {this.LastName} is {this.Age} years old.";
        }

        public void IncreaseSalary(decimal percentage)
        {
            var delimiter = 100;
            if(this.Age < 30)
            {
                delimiter = 200;
            }

            this.Salary += this.Salary * percentage / delimiter;

        }
    }
}
<file_sep>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P01.ListyIterator
{
    public class ListyIterator<T> : IEnumerable<T>
    {
        private readonly List<T> data;
        private int currInternalIndex;

        public ListyIterator()
        {
            this.data = new List<T>();
            this.currInternalIndex = 0;
        }
        public ListyIterator(IEnumerable<T> collectionData)
        {
            this.data = new List<T>(collectionData);
        }

        public bool Move()
        {
            if(this.currInternalIndex < this.data.Count - 1)
            {
                this.currInternalIndex++;
            }
            else
            {
                return false;
            }
            return true;
        }

        public bool HasNext()
        {
            return this.currInternalIndex < this.data.Count - 1;
        }

        public void Print()
        {
            if (!this.data.Any())
            {
                throw new InvalidOperationException("Invalid operation!");
            }

            Console.WriteLine(this.data[this.currInternalIndex]);
        }

        public IEnumerator<T> GetEnumerator()
        {
            for (int i = 0; i < this.data.Count; i++)
            {
                yield return this.data[i];
            }
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}
<file_sep>﻿using System;

namespace Array
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] ages = new int[3];
            ages[0] = 5;
            ages[1] = 6;
            ages[2] = 7;

            /*foreach(int age in ages)
            {
                Console.WriteLine(age);
            }*/
            for (int i = 0; i < ages.Length; i++)
            {
                Console.WriteLine(ages[i]);
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace _06._List_Manipulation_Basics
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine().Split().Select(int.Parse).ToList();
            while (true)
            {
                string input = Console.ReadLine();
                if(input == "end")
                {
                    break;
                }
                string[] command = input.Split();
                if(command[0] == "Add")
                {
                    list.Add(int.Parse(command[1]));
                }
                else if(command[0] == "Remove")
                {
                    list.Remove(int.Parse(command[1]));
                }
                else if(command[0] == "RemoveAt")
                {
                    list.RemoveAt(int.Parse(command[1]));
                }
                else
                {
                    list.Insert(int.Parse(command[2]), int.Parse(command[1]));
                }
            }
            Console.WriteLine(string.Join(" ", list));
        }
    }
}
<file_sep>﻿using System;
using System.Diagnostics.CodeAnalysis;

namespace Travelling
{
    class Program
    {
        static void Main(string[] args)
        {
            string destination = Console.ReadLine();
            while(destination != "End")
            {
                double sum = 0;
                double neededSum = double.Parse(Console.ReadLine());
                while(sum<neededSum)
                {
                    double savedMoney = double.Parse(Console.ReadLine());
                    sum += savedMoney;
                }
                Console.WriteLine($"Going to {destination}!");
                destination = Console.ReadLine();
            }
        }
    }
}
