using System.Diagnostics; using System.Numerics; public class Program { public static void Main() { //BigInteger num = BigInteger.Parse(Console.ReadLine() ?? string.Empty); //int num = int.Parse(Console.ReadLine() ?? string.Empty); string[] moji = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); //string str = Console.ReadLine() ?? string.Empty; int reef = int.Parse(moji[0]); int fall = int.Parse(moji[1]); int start = int.Parse(moji[2]); int end = int.Parse(moji[3]); int month = 1; int monthCount = 0; while(reef > 0) { if(month >=start && month <= start+end-1) { reef -= fall * 2; } else { reef -= fall; } monthCount++; month++; if(month ==13) { month = 1; } } Console.WriteLine(monthCount); } }