private static int CalculateEstimatedLengthInDays(Contest contest)
{
if (contest.Mode == ContestEndMode.TimeBased)
{
return contest.EndTime.Value.Subtract(contest.StartTime).Days;
}
else // ContestEndMode.GoalBased
{
List<float> expectedPerDay = new List<float> { 7000, 2, 4, 1, 0.6f, 1, 7, 1.25f, 0.5f, 0.5f, 0.25f };
return (int)Math.Round(contest.EndValue.Value / expectedPerDay[(int)contest.StatisticBinding]);
}
}