public ArmyType Type { get; set; }
public int WarriorsCountPerType { get; set; }
public WarriorType[] WarriorTypes { get; set; }
public static void Main()
int minArmyCount = (int)(liArmyCount * 1.5);
WarriorsCountPerType = liArmyCount,
WarriorTypes = new WarriorType[]
WarriorsCountPerType = minArmyCount,
WarriorTypes = new WarriorType[]
foreach (var army in armies)
var armyPower = CalculatePower(army);
Console.WriteLine($"army {army.Type} power: {armyPower}");
public static int CalculatePower(Army army)
return CalculateLiArmyPower(army);
return CalculateMinArmyPower(army);
throw new Exception("Unsupported type of army.");
public static int CalculateLiArmyPower(Army army)
foreach (var warriorType in army.WarriorTypes)
case WarriorType.Infantry:
case WarriorType.Cavalery:
throw new Exception("Unsupported type of warrior.");
public static int CalculateMinArmyPower(Army army)
foreach (var warriorType in army.WarriorTypes)
case WarriorType.Infantry:
case WarriorType.Cavalery:
throw new Exception("Unsupported type of warrior.");