using System; using System.Collections.Generic; public class Program { public void Proc() { Reader.IsDebug = false; int cnt = int.Parse(Reader.ReadLine()); int[] inpt = Reader.GetInt(); for(int i=0; i tekiOriginal = new List(); tekiOriginal.AddRange(inpt); int ans = int.MaxValue; for(int i=0; i 0) { tekiOriginal.CopyTo(0, tekiArray, tekiOriginal.Count - i, i); } int maxCount = 0; for(int j=0; j{ if(a.Level < b.Level) { return -1; } else if(a.Level > b.Level) { return 1; } else if(a.Count < b.Count) { return - 1; } else if(a.Count > b.Count) { return 1; } return 0; }); this.MikataList[0].Level += (tekiArray[j] / 2); this.MikataList[0].Count++; maxCount = Math.Max(maxCount, this.MikataList[0].Count); } ans = Math.Min(ans, maxCount); } Console.WriteLine(ans); } private List MikataList = new List(); public class Mikata { public int Level = 0; public int Count = 0; public Mikata(int defaultLevel) { this.Level = defaultLevel; } } public class Reader { private static String InitText = @" 5 6 1 5 9 2 7 7 9 4 4 "; private static System.IO.StringReader sr = null; public static bool IsDebug = true; public static string ReadLine() { if(IsDebug) { if(sr == null) { sr = new System.IO.StringReader(InitText.Trim()); } return sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ') { string[] inpt = ReadLine().Split(delimiter); int[] ret = new int[inpt.Length]; for(int i=0; i