using System.Collections.Generic;
const int MaxCoefFicient = 50;
public static void Main()
Console.Write("Введите сумму ставки:");
var totalAmount = Convert.ToDouble(Console.ReadLine());
Console.Write("Введите количество пар:");
var pairCount = Convert.ToInt32(Console.ReadLine());
var pairsList = new List<HorsePair>();
for(var i = 1; i <= pairCount; i++)
Console.Write("Кличка лошади №" + i.ToString());
var horseName = Console.ReadLine();
Console.Write("Коэффициент для {0}:", horseName);
var rate = Convert.ToInt32(Console.ReadLine());
pairsList.Add(new HorsePair(horseName, rate, 0));
var lowestRate = pairsList.Min(x => x.Rate);
for(var i = 0; i < pairCount; i++)
var currentCoef = ((double)lowestRate/(double)item.Rate)*MaxCoefFicient;
item.Coefficient = currentCoef;
Console.WriteLine("Коэффициенты:");
foreach(var item in pairsList)
Console.WriteLine("{0} : {1}", item.Horse, item.Coefficient);
var totalSum = pairsList.OrderByDescending(x => x.Rate).Skip(1).Sum(x => x.Coefficient);
foreach (var item in pairsList.OrderByDescending(x => x.Rate).Skip(1))
item.Amount = totalAmount * (item.Coefficient / totalSum);
Console.WriteLine("Распределение по суммам:");
foreach(var item in pairsList)
Console.WriteLine("{0} : {1}", item.Horse, item.Amount);
public HorsePair(string horse, int rate, double coefficient)
Coefficient = coefficient;
public int Rate { get; set; }
public string Horse { get; set; }
public double Coefficient { get; set; }
public double Amount { get; set; }