using System; using System.Linq; using System.Collections.Generic; namespace ConsoleApp1 { class Program { class main { public static void Main() { static string Get() { return Console.ReadLine(); } List Cars = new List(); List Trucks = new List(); while (true) { string command = Get(); if (command == "End") { break; } else { string[] data = command.Split(" ").ToArray(); string type = data[0]; string color = data[2]; string model = data[1]; double HorsePowerOrWeight = double.Parse(data[3]); if (type == "car") { Car thisCar = new Car(); thisCar.Brand = color; thisCar.Model = model; thisCar.HorsePower = HorsePowerOrWeight; thisCar.Color = color; Cars.Add(thisCar); } else { Truck thisTruck = new Truck(); thisTruck.Brand = color; thisTruck.Model = model; thisTruck.Horsepower = HorsePowerOrWeight; thisTruck.Color = color; Trucks.Add(thisTruck); } } } List Vehicles = new List(); while (true) { string command = Get(); if (command == "Close the Catalogue") { break; } else { Vehicles.Add(command); } } int totalCars = Cars.Count; ; double allSpeeds = 0; int totalTrucks = Trucks.Count; double allSpeedsTrucks = 0; for (int i = 0; i < Vehicles.Count; i++) { if (Vehicles.Contains(Cars[i].Model)) { for (int x =0; x Cars { get; set; } public List Trucks { get; set; } } } }