using System; using System.Collections.Generic; using System.Linq; namespace StudyApp { class Program { static void Main(string[] args) { string[] inputs = Console.ReadLine().Split(' '); int initial = int.Parse(inputs[0]); int lost = int.Parse(inputs[1]); int current_month = 1; List windy_month = GetWindyMonth(int.Parse(inputs[2]), int.Parse(inputs[3])).ToList(); int month_num = 0; while (initial > 0) { if (windy_month.Contains(current_month)) { initial -= lost * 2; } else { initial -= lost; } current_month = current_month == 12 ? 1 : current_month + 1; month_num++; } Console.WriteLine(month_num); } static IEnumerable GetWindyMonth(int start_month, int months) { for (int i = 0; i < months; i++) { yield return start_month + i; } } } }