using System; using System.Collections.Generic; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("30"); WillReturn.Add("5"); //19 //仕事量が30で、締め切りまでの日数は5である。 //この時、 //1日目のやる気は30/(5の2乗) =1.2 であるため、この日の作業量は1である。 //2日目のやる気は29/(4の2乗) =1.8125 であるため、この日も作業量は1である。 //3日目のやる気は28/(3の2乗) =3.111.. であるため、この日の作業量は3である。 //4日目のやる気は25/(2の2乗) =6.25 であるため、この日の作業量は6である。 //5日目のやる気は19/(1の2乗) =19 であるため、この日の作業量は19である。 // //つまり、最後の日に行った作業量は19である。 } else if (InputPattern == "Input2") { WillReturn.Add("100"); WillReturn.Add("2"); //75 //1日目のやる気は 100/(2の2乗) =25であるため、この日の作業量25である。 //2日目のやる気は 75/(1の2乗) =75であるため、この日の作業量75である。 // //最終日に行った作業量は75になる。 } else if (InputPattern == "Input3") { WillReturn.Add("100000"); WillReturn.Add("1"); //100000 // //作業量100000を一日で終わらせました } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); long W = long.Parse(InputList[0]); long D = long.Parse(InputList[1]); for (; 1 <= D; D--) { long CurrSagyouyou = W / (D * D); W -= CurrSagyouyou; //Console.WriteLine("残り{0}日での作業量={1}", D, CurrSagyouyou); if (W <= 0) { Console.WriteLine(CurrSagyouyou); break; } } } }