using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("7 3"); } else if (InputPattern == "Input2") { WillReturn.Add("6 3"); } else if (InputPattern == "Input3") { WillReturn.Add("5 5"); } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static long[] GetSplitArr(string pStr) { return (pStr == "" ? new string[0] : pStr.Split(' ')).Select(pX => long.Parse(pX)).ToArray(); } static void Main() { List InputList = GetInputList(); long[] wkArr = GetSplitArr(InputList[0]); long N = wkArr[0]; long K = wkArr[1]; long Div = N / K; long Mod = N % K; var AnswerList = new List(); for (long I = 1; I <= K; I++) { AnswerList.Add(Div); } int CurrInd = 0; for (long I = 1; I <= K; I++) { if (Mod > 0) { AnswerList[CurrInd]++; CurrInd++; Mod--; } } Console.WriteLine(LongEnumJoin(" ", AnswerList)); } // セパレータとLong型の列挙を引数として、結合したstringを返す static string LongEnumJoin(string pSeparater, IEnumerable pEnum) { string[] StrArr = Array.ConvertAll(pEnum.ToArray(), pX => pX.ToString()); return string.Join(pSeparater, StrArr); } }